#include "fl_compositor_opengl.h"#include <epoxy/egl.h>#include <epoxy/gl.h>#include "flutter/common/constants.h"#include "flutter/shell/platform/embedder/embedder.h"#include "flutter/shell/platform/linux/fl_engine_private.h"#include "flutter/shell/platform/linux/fl_framebuffer.h"Go to the source code of this file.
Classes | |
| struct | _FlCompositorOpenGL |
| struct | PresentLayersData |
Functions | |
| G_DEFINE_TYPE (FlCompositorOpenGL, fl_compositor_opengl, fl_compositor_get_type()) static gboolean is_nvidia() | |
| static gboolean | is_vivante () |
| static gchar * | get_shader_log (GLuint shader) |
| static gchar * | get_program_log (GLuint program) |
| static GLfloat | pixels_to_gl_coords (GLfloat position, GLfloat pixels) |
| Converts a pixel co-ordinate from 0..pixels to OpenGL -1..1. More... | |
| static void | initialize (FlCompositorOpenGL *self) |
| static void | fl_compositor_opengl_unblock_main_thread (FlCompositorOpenGL *self) |
| static void | setup_shader (FlCompositorOpenGL *self) |
| static void | render_with_blit (FlCompositorOpenGL *self, GPtrArray *framebuffers) |
| static void | render_with_textures (FlCompositorOpenGL *self, GPtrArray *framebuffers, int width, int height) |
| static void | render (FlCompositorOpenGL *self, GPtrArray *framebuffers, int width, int height) |
| static gboolean | present_layers (FlCompositorOpenGL *self, FlutterViewId view_id, const FlutterLayer **layers, size_t layers_count) |
| static void | present_layers_task_cb (gpointer user_data) |
| static gboolean | fl_compositor_opengl_create_backing_store (FlCompositor *compositor, const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out) |
| static gboolean | fl_compositor_opengl_collect_backing_store (FlCompositor *compositor, const FlutterBackingStore *backing_store) |
| static void | fl_compositor_opengl_wait_for_frame (FlCompositor *compositor, int target_width, int target_height) |
| static gboolean | fl_compositor_opengl_present_layers (FlCompositor *compositor, FlutterViewId view_id, const FlutterLayer **layers, size_t layers_count) |
| static void | fl_compositor_opengl_dispose (GObject *object) |
| static void | fl_compositor_opengl_class_init (FlCompositorOpenGLClass *klass) |
| static void | fl_compositor_opengl_init (FlCompositorOpenGL *self) |
| FlCompositorOpenGL * | fl_compositor_opengl_new (FlEngine *engine) |
| void | fl_compositor_opengl_setup (FlCompositorOpenGL *self) |
| void | fl_compositor_opengl_render (FlCompositorOpenGL *self, FlutterViewId view_id, int width, int height, const GdkRGBA *background_color) |
| void | fl_compositor_opengl_cleanup (FlCompositorOpenGL *self) |
Variables | |
| static const char * | vertex_shader_src |
| static const char * | fragment_shader_src |
|
static |
Definition at line 550 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_collect_backing_store(), fl_compositor_opengl_create_backing_store(), fl_compositor_opengl_dispose(), fl_compositor_opengl_present_layers(), and fl_compositor_opengl_wait_for_frame().
| void fl_compositor_opengl_cleanup | ( | FlCompositorOpenGL * | compositor | ) |
fl_compositor_opengl_cleanup: @compositor: an #FlCompositorOpenGL.
Removes OpenGL resources used for rendering. Requires an active context.
Definition at line 617 of file fl_compositor_opengl.cc.
Referenced by unrealize_cb().
|
static |
Definition at line 470 of file fl_compositor_opengl.cc.
References fl_opengl_manager_make_current(), and TRUE.
Referenced by fl_compositor_opengl_class_init().
|
static |
Definition at line 438 of file fl_compositor_opengl.cc.
References fl_framebuffer_get_id(), fl_framebuffer_new(), fl_opengl_manager_make_current(), initialize(), and TRUE.
Referenced by fl_compositor_opengl_class_init().
|
static |
Definition at line 536 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_unblock_main_thread().
Referenced by fl_compositor_opengl_class_init().
|
static |
Definition at line 563 of file fl_compositor_opengl.cc.
| FlCompositorOpenGL* fl_compositor_opengl_new | ( | FlEngine * | engine | ) |
Definition at line 571 of file fl_compositor_opengl.cc.
References fl_engine_get_opengl_manager().
Referenced by fl_engine_new_full(), and TEST().
|
static |
Definition at line 499 of file fl_compositor_opengl.cc.
References PresentLayersData::finished, fl_engine_get_task_runner(), fl_opengl_manager_clear_current(), fl_opengl_manager_make_current(), fl_task_runner_post_callback(), present_layers_task_cb(), PresentLayersData::result, PresentLayersData::self, and view_id.
Referenced by fl_compositor_opengl_class_init().
| void fl_compositor_opengl_render | ( | FlCompositorOpenGL * | compositor, |
| FlutterViewId | view_id, | ||
| int | width, | ||
| int | height, | ||
| const GdkRGBA * | background_color | ||
| ) |
fl_compositor_opengl_render: @compositor: an #FlCompositorOpenGL. @view_id: view to render. @width: width of the window in pixels. @height: height of the window in pixels. @background_color: color to use for background.
Performs OpenGL commands to render current Flutter view.
Definition at line 597 of file fl_compositor_opengl.cc.
References height, render(), view_id, and width.
Referenced by render_cb(), and TEST().
| void fl_compositor_opengl_setup | ( | FlCompositorOpenGL * | compositor | ) |
fl_compositor_opengl_setup: @compositor: an #FlCompositorOpenGL.
Creates OpenGL resources required before rendering. Requires an active context.
Definition at line 582 of file fl_compositor_opengl.cc.
References is_vivante(), and setup_shader().
Referenced by realize_cb(), and TEST().
|
static |
Definition at line 149 of file fl_compositor_opengl.cc.
References fl_engine_get_task_runner(), and fl_task_runner_release_main_thread().
Referenced by fl_compositor_opengl_dispose(), and present_layers().
|
static |
Definition at line 482 of file fl_compositor_opengl.cc.
References fl_engine_get_task_runner(), and fl_task_runner_block_main_thread().
Referenced by fl_compositor_opengl_class_init().
| G_DEFINE_TYPE | ( | FlCompositorOpenGL | , |
| fl_compositor_opengl | , | ||
| fl_compositor_get_type() | |||
| ) |
Definition at line 86 of file fl_compositor_opengl.cc.
|
static |
|
static |
|
static |
Definition at line 134 of file fl_compositor_opengl.cc.
References TRUE.
Referenced by fl_compositor_opengl_create_backing_store().
|
static |
|
static |
Converts a pixel co-ordinate from 0..pixels to OpenGL -1..1.
Definition at line 129 of file fl_compositor_opengl.cc.
Referenced by render_with_textures().
|
static |
Definition at line 295 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_unblock_main_thread(), fl_engine_get_renderable(), fl_framebuffer_get_height(), fl_framebuffer_get_id(), fl_framebuffer_get_texture_id(), fl_framebuffer_get_width(), fl_framebuffer_new(), fl_renderable_make_current(), fl_renderable_redraw(), height, i, render(), TRUE, view_id, and width.
Referenced by present_layers_task_cb().
|
static |
Definition at line 422 of file fl_compositor_opengl.cc.
References PresentLayersData::finished, fl_opengl_manager_clear_current(), fl_opengl_manager_make_current(), PresentLayersData::layers, PresentLayersData::layers_count, present_layers(), PresentLayersData::result, PresentLayersData::self, TRUE, user_data, and PresentLayersData::view_id.
Referenced by fl_compositor_opengl_present_layers().
|
static |
Definition at line 284 of file fl_compositor_opengl.cc.
References height, render_with_blit(), render_with_textures(), and width.
Referenced by fl_compositor_opengl_render(), and present_layers().
|
static |
Definition at line 197 of file fl_compositor_opengl.cc.
References fl_framebuffer_get_height(), fl_framebuffer_get_id(), fl_framebuffer_get_width(), height, i, and width.
Referenced by render().
|
static |
Definition at line 218 of file fl_compositor_opengl.cc.
References fl_framebuffer_get_height(), fl_framebuffer_get_texture_id(), fl_framebuffer_get_width(), height, i, pixels_to_gl_coords(), texture_id, and width.
Referenced by render().
|
static |
Definition at line 160 of file fl_compositor_opengl.cc.
References fragment_shader_src, get_program_log(), get_shader_log(), and vertex_shader_src.
Referenced by fl_compositor_opengl_setup().
|
static |
Definition at line 27 of file fl_compositor_opengl.cc.
Referenced by setup_shader().
|
static |
Definition at line 16 of file fl_compositor_opengl.cc.
Referenced by setup_shader().