mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Acquire context reference at the correct time for FlGlArea. (flutter/engine#29791)
This is a reland of flutter/engine#29178 onto the main branch. The original patch was landed on the master branch during the branch switch from master to main.
This commit is contained in:
parent
baab0c1ca8
commit
dd669f3631
@ -118,7 +118,7 @@ GtkWidget* fl_gl_area_new(GdkGLContext* context) {
|
||||
g_return_val_if_fail(GDK_IS_GL_CONTEXT(context), nullptr);
|
||||
FlGLArea* area =
|
||||
reinterpret_cast<FlGLArea*>(g_object_new(fl_gl_area_get_type(), nullptr));
|
||||
area->context = context;
|
||||
area->context = GDK_GL_CONTEXT(g_object_ref(context));
|
||||
return GTK_WIDGET(area);
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +103,6 @@ static gboolean fl_renderer_gl_present_layers(FlRenderer* renderer,
|
||||
case kFlutterLayerContentTypeBackingStore: {
|
||||
const FlutterBackingStore* backing_store = layer->backing_store;
|
||||
auto framebuffer = &backing_store->open_gl.framebuffer;
|
||||
g_object_ref(context);
|
||||
fl_view_add_gl_area(
|
||||
view, context,
|
||||
reinterpret_cast<FlBackingStoreProvider*>(framebuffer->user_data));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user