Skip to content

Commit 5c4edc2

Browse files
Fix Linux OpenGL compositor on ARM driver (flutter#166753)
Fix Linux OpenGL compositor on ARM driver. Add "ARM" to the list of drivers unsupported by the gl_framebuffer_blit based rendering. flutter#152099 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Robert Ancell <[email protected]>
1 parent b6100b7 commit 5c4edc2

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

engine/src/flutter/shell/platform/linux/fl_compositor_opengl.cc

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,26 @@ G_DEFINE_TYPE(FlCompositorOpenGL,
8787
fl_compositor_opengl,
8888
fl_compositor_get_type())
8989

90-
// Check if running on an NVIDIA driver.
91-
static gboolean is_nvidia() {
90+
// Check if running on driver supporting blit.
91+
static gboolean driver_supports_blit() {
9292
const gchar* vendor = reinterpret_cast<const gchar*>(glGetString(GL_VENDOR));
93-
return strstr(vendor, "NVIDIA") != nullptr;
94-
}
9593

96-
// Check if running on an Vivante Corporation driver.
97-
static gboolean is_vivante() {
98-
const gchar* vendor = reinterpret_cast<const gchar*>(glGetString(GL_VENDOR));
99-
return strstr(vendor, "Vivante Corporation") != nullptr;
94+
// Note: List of unsupported vendors due to issue
95+
// https://github.com/flutter/flutter/issues/152099
96+
const char* unsupported_vendors_exact[] = {"Vivante Corporation", "ARM"};
97+
const char* unsupported_vendors_fuzzy[] = {"NVIDIA"};
98+
99+
for (const char* unsupported : unsupported_vendors_fuzzy) {
100+
if (strstr(vendor, unsupported) != nullptr) {
101+
return FALSE;
102+
}
103+
}
104+
for (const char* unsupported : unsupported_vendors_exact) {
105+
if (strcmp(vendor, unsupported) == 0) {
106+
return FALSE;
107+
}
108+
}
109+
return TRUE;
100110
}
101111

102112
// Returns the log for the given OpenGL shader. Must be freed by the caller.
@@ -445,10 +455,8 @@ static void fl_compositor_opengl_setup(FlCompositor* compositor) {
445455

446456
fl_opengl_manager_make_current(self->opengl_manager);
447457

448-
// Note: NVIDIA and Vivante are temporarily disabled due to
449-
// https://github.com/flutter/flutter/issues/152099
450458
self->has_gl_framebuffer_blit =
451-
!is_nvidia() && !is_vivante() &&
459+
driver_supports_blit() &&
452460
(epoxy_gl_version() >= 30 ||
453461
epoxy_has_gl_extension("GL_EXT_framebuffer_blit"));
454462

0 commit comments

Comments
 (0)