#include <gtk/gtk.h>#include "flutter/shell/platform/embedder/embedder.h"#include "flutter/shell/platform/linux/fl_framebuffer.h"#include "flutter/shell/platform/linux/fl_opengl_manager.h"Go to the source code of this file.
Functions | |
| G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlCompositorOpenGL, fl_compositor_opengl, FL, COMPOSITOR_OPENGL, GObject) FlCompositorOpenGL *fl_compositor_opengl_new(FlOpenGLManager *opengl_manager |
| gboolean | fl_compositor_opengl_composite_layers (FlCompositorOpenGL *compositor, const FlutterLayer **layers, size_t layers_count) |
| void | fl_compositor_opengl_get_frame_size (FlCompositorOpenGL *compositor, size_t *width, size_t *height) |
| gboolean | fl_compositor_opengl_render (FlCompositorOpenGL *compositor, cairo_t *cr, GdkWindow *window) |
Variables | |
| G_BEGIN_DECLS gboolean | shareable |
| gboolean 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 stored frame using the current OpenGL context.
Returns TRUE if successful.
Definition at line 86 of file fl_compositor_opengl.cc.
References FlutterLayer::backing_store, composite_layer(), epoxy_has_gl_extension(), fl_compositor_opengl_shader_use(), fl_framebuffer_get_height(), fl_framebuffer_get_id(), fl_framebuffer_get_width(), fl_framebuffer_new(), FlutterOpenGLBackingStore::framebuffer, height, FlutterSize::height, i, kFlutterLayerContentTypeBackingStore, kFlutterLayerContentTypePlatformView, layers, layers_count, FlutterLayer::offset, FlutterBackingStore::open_gl, self, FlutterLayer::size, TRUE, FlutterLayer::type, FlutterOpenGLFramebuffer::user_data, width, FlutterSize::width, FlutterPoint::x, and FlutterPoint::y.
Referenced by fl_view_renderer_opengl_present_layers(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| void fl_compositor_opengl_get_frame_size | ( | FlCompositorOpenGL * | compositor, |
| size_t * | width, | ||
| size_t * | height | ||
| ) |
fl_compositor_opengl_get_frame_size: @compositor: an #FlCompositorOpenGL. @width: location to write frame width in pixels. @height: location to write frame height in pixels.
Get the size of the layer ready for rendering.
Definition at line 225 of file fl_compositor_opengl.cc.
References fl_framebuffer_get_height(), fl_framebuffer_get_width(), height, self, and width.
Referenced by G_DEFINE_TYPE(), TEST_F(), TEST_F(), and wait_for_frame().
| gboolean fl_compositor_opengl_render | ( | FlCompositorOpenGL * | compositor, |
| cairo_t * | cr, | ||
| GdkWindow * | window | ||
| ) |
fl_compositor_opengl_render: @compositor: an #FlCompositorOpenGL. @cr: a Cairo rendering context. @window: window being rendered into.
Renders the current frame using the current OpenGL context.
Returns TRUE if successful.
Definition at line 240 of file fl_compositor_opengl.cc.
References fl_framebuffer_create_sibling(), fl_framebuffer_get_height(), fl_framebuffer_get_shareable(), fl_framebuffer_get_texture_id(), fl_framebuffer_get_width(), g_autoptr(), gdk_cairo_draw_from_gl(), gdk_window_get_height(), gdk_window_get_scale_factor(), gdk_window_get_width(), height, self, texture_id, TRUE, width, and window.
Referenced by fl_view_renderer_opengl_draw(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlCompositorOpenGL | , |
| fl_compositor_opengl | , | ||
| FL | , | ||
| COMPOSITOR_OPENGL | , | ||
| GObject | |||
| ) |
FlCompositorOpenGL:
#FlCompositorOpenGL is class that implements compositing using OpenGL.
The composited frame is stored in an OpenGL framebuffer (texture).
A frame may be written by fl_compositor_opengl_composite_layers using one OpenGL context and read by fl_compositor_opengl_render using another. When the compositor is created as shareable the two contexts must belong to the same share group so the frame texture can be accessed from both, and the writing context issues a glFlush() so the frame is visible to the reading context. When not shareable the frame is copied to CPU memory by the writing context and uploaded into a new texture by the reading context. fl_compositor_opengl_new: @opengl_manager: an #FlOpenGLManager @shareable: TRUE if the compositor can use a framebuffer that is shared between contexts.
Creates a new OpenGL compositor.
Returns: a new #FlCompositorOpenGL.
| G_BEGIN_DECLS gboolean shareable |
Definition at line 49 of file fl_compositor_opengl.h.
Referenced by fl_compositor_opengl_new(), fl_framebuffer_new(), and fl_view_renderer_opengl_realize().