#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 driver_supports_blit() | |
static gchar * | get_shader_log (GLuint shader) |
static gchar * | get_program_log (GLuint program) |
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, const FlutterLayer **layers, size_t layers_count) |
static void | present_layers_task_cb (gpointer user_data) |
static FlutterRendererType | fl_compositor_opengl_get_renderer_type (FlCompositor *compositor) |
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, 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, GdkGLContext *context) |
void | fl_compositor_opengl_render (FlCompositorOpenGL *self, int width, int height) |
void | fl_compositor_opengl_cleanup (FlCompositorOpenGL *self) |
Variables | |
static const char * | vertex_shader_src |
static const char * | fragment_shader_src |
|
static |
Definition at line 503 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_dispose(), fl_compositor_opengl_get_renderer_type(), 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 558 of file fl_compositor_opengl.cc.
Referenced by unrealize_cb().
|
static |
Definition at line 488 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_unblock_main_thread().
Referenced by fl_compositor_opengl_class_init().
|
static |
Definition at line 431 of file fl_compositor_opengl.cc.
Referenced by fl_compositor_opengl_class_init().
|
static |
Definition at line 514 of file fl_compositor_opengl.cc.
FlCompositorOpenGL* fl_compositor_opengl_new | ( | FlEngine * | engine, |
GdkGLContext * | context | ||
) |
Definition at line 520 of file fl_compositor_opengl.cc.
References context, fl_engine_get_opengl_manager(), fl_opengl_manager_make_current(), and setup_shader().
Referenced by realize_cb(), and TEST().
|
static |
Definition at line 453 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, and PresentLayersData::self.
Referenced by fl_compositor_opengl_class_init().
void fl_compositor_opengl_render | ( | FlCompositorOpenGL * | compositor, |
int | width, | ||
int | height | ||
) |
fl_compositor_opengl_render: @compositor: an #FlCompositorOpenGL. @width: width of the window in pixels. @height: height of the window in pixels.
Performs OpenGL commands to render current Flutter view.
Definition at line 545 of file fl_compositor_opengl.cc.
References height, render(), and width.
Referenced by render_cb(), and TEST().
|
static |
Definition at line 143 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 436 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() | |||
) |
|
static |
|
static |
|
static |
Definition at line 300 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_unblock_main_thread(), fl_framebuffer_get_height(), fl_framebuffer_get_id(), fl_framebuffer_get_texture_id(), fl_framebuffer_get_width(), fl_framebuffer_new(), height, i, render(), TRUE, and width.
Referenced by present_layers_task_cb().
|
static |
Definition at line 416 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, and user_data.
Referenced by fl_compositor_opengl_present_layers().
|
static |
Definition at line 289 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 206 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 227 of file fl_compositor_opengl.cc.
References fl_framebuffer_get_height(), fl_framebuffer_get_texture_id(), fl_framebuffer_get_width(), height, i, texture_id, and width.
Referenced by render().
|
static |
Definition at line 154 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_new().
|
static |
Definition at line 29 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().