Skip to content

Commit e983e59

Browse files
Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (#172090)
This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
1 parent c0f1279 commit e983e59

13 files changed

Lines changed: 335 additions & 294 deletions

‎engine/src/flutter/shell/platform/linux/fl_compositor.cc‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ static void fl_compositor_class_init(FlCompositorClass* klass) {}
1212

1313
static void fl_compositor_init(FlCompositor* self) {}
1414

15-
FlutterRendererType fl_compositor_get_renderer_type(FlCompositor* self) {
16-
g_return_val_if_fail(FL_IS_COMPOSITOR(self),
17-
static_cast<FlutterRendererType>(0));
18-
return FL_COMPOSITOR_GET_CLASS(self)->get_renderer_type(self);
19-
}
20-
2115
void fl_compositor_wait_for_frame(FlCompositor* self,
2216
int target_width,
2317
int target_height) {

‎engine/src/flutter/shell/platform/linux/fl_compositor.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ G_DECLARE_DERIVABLE_TYPE(FlCompositor, fl_compositor, FL, COMPOSITOR, GObject)
1616
struct _FlCompositorClass {
1717
GObjectClass parent_class;
1818

19-
FlutterRendererType (*get_renderer_type)(FlCompositor* compositor);
20-
2119
gboolean (*present_layers)(FlCompositor* compositor,
2220
const FlutterLayer** layers,
2321
size_t layers_count);
@@ -33,16 +31,6 @@ struct _FlCompositorClass {
3331
* #FlCompositor is an abstract class that implements Flutter compositing.
3432
*/
3533

36-
/**
37-
* fl_compositor_get_renderer_type:
38-
* @compositor: an #FlCompositor.
39-
*
40-
* Gets the rendering method this compositor uses.
41-
*
42-
* Returns: a FlutterRendererType.
43-
*/
44-
FlutterRendererType fl_compositor_get_renderer_type(FlCompositor* compositor);
45-
4634
/**
4735
* fl_compositor_present_layers:
4836
* @compositor: an #FlCompositor.

0 commit comments

Comments
 (0)