#include "fl_compositor_opengl.h"#include <epoxy/egl.h>#include <epoxy/gl.h>#include <cstring>#include "flutter/common/constants.h"#include "flutter/shell/platform/embedder/embedder.h"#include "flutter/shell/platform/linux/fl_compositor_opengl_shader.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 |
Functions | |
| 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 (FlOpenGLManager *opengl_manager) |
| static void | composite_layer (FlCompositorOpenGL *self, FlFramebuffer *framebuffer, double x, double y, int width, int height) |
| void | fl_compositor_opengl_composite_layers (FlCompositorOpenGL *self, const FlutterLayer **layers, size_t layers_count) |
| FlOpenGLManager * | fl_compositor_opengl_get_opengl_manager (FlCompositorOpenGL *self) |
| gboolean | fl_compositor_opengl_can_fence (FlCompositorOpenGL *self) |
| GLint | fl_compositor_opengl_get_frame_format (const FlutterLayer **layers, size_t layers_count) |
|
static |
Definition at line 66 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_shader_set_offset(), fl_compositor_opengl_shader_set_scale(), fl_framebuffer_get_height(), fl_framebuffer_get_texture_id(), fl_framebuffer_get_width(), height, texture_id, and width.
Referenced by fl_compositor_opengl_composite_layers().
| gboolean fl_compositor_opengl_can_fence | ( | FlCompositorOpenGL * | compositor | ) |
fl_compositor_opengl_can_fence: @compositor: an #FlCompositorOpenGL.
Checks whether fences can be used to synchronize a composited frame with the context that presents it. Callers have to fall back to waiting for the rendering to complete, e.g. with glFinish(), when this returns FALSE.
Returns: TRUE if fences are available.
Definition at line 199 of file fl_compositor_opengl.cc.
|
static |
Definition at line 45 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_dispose().
| void fl_compositor_opengl_composite_layers | ( | FlCompositorOpenGL * | compositor, |
| const FlutterLayer ** | layers, | ||
| size_t | layers_count | ||
| ) |
fl_compositor_opengl_composite_layers: @compositor: an #FlCompositorOpenGL. @layers: layers to be composited. @layers_count: number of layers.
Composite @layers into the OpenGL framebuffer bound to the current OpenGL context. The caller is responsible for binding the target framebuffer before calling this function.
Definition at line 85 of file fl_compositor_opengl.cc.
References composite_layer(), fl_compositor_opengl_shader_use(), fl_framebuffer_get_id(), height, i, layers, layers_count, TRUE, and width.
Referenced by fl_opengl_frame_composite(), and TEST_F().
|
static |
Definition at line 36 of file fl_compositor_opengl.cc.
Referenced by fl_compositor_opengl_class_init().
| GLint fl_compositor_opengl_get_frame_format | ( | const FlutterLayer ** | layers, |
| size_t | layers_count | ||
| ) |
fl_compositor_opengl_get_frame_format: @layers: layers the frame is composited from. @layers_count: number of layers.
Gets the texture format to composite @layers into. This matches the format the engine rendered them with, so the composited frame can be read back correctly. Compositing into a mismatched format produces an empty frame.
Returns: a texture format, e.g. GL_RGBA or GL_BGRA_EXT.
Definition at line 204 of file fl_compositor_opengl.cc.
References i, layers, and layers_count.
Referenced by fl_opengl_frame_composite(), and TEST_F().
| FlOpenGLManager* fl_compositor_opengl_get_opengl_manager | ( | FlCompositorOpenGL * | compositor | ) |
fl_compositor_opengl_get_opengl_manager: @compositor: an #FlCompositorOpenGL.
Gets the OpenGL manager the frames are composited with.
Returns: an #FlOpenGLManager.
Definition at line 193 of file fl_compositor_opengl.cc.
|
static |
Definition at line 49 of file fl_compositor_opengl.cc.
| FlCompositorOpenGL* fl_compositor_opengl_new | ( | FlOpenGLManager * | opengl_manager | ) |
Definition at line 51 of file fl_compositor_opengl.cc.
References fl_compositor_opengl_shader_new(), fl_opengl_manager_can_blit(), fl_opengl_manager_can_fence(), and fl_opengl_manager_make_current().
Referenced by FlOpenGLFrameTest::SetUp(), and TEST_F().