From 65c2deace4e1c51bc382751e85d132fa4d8ac7d8 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Sun, 3 Apr 2022 14:34:13 +0800 Subject: [PATCH] import from UXP: Issue #1061 - Enable double buffering when using XRENDER. (28fbea67) --- gfx/layers/client/ContentClient.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 57b295382..c57f000fd 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -78,8 +78,21 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder) // We can't use double buffering when using image content with // Xrender support on Linux, as ContentHostDoubleBuffered is not // suited for direct uploads to the server. + // FIXME: Even though the comment above suggests that double buffering + // is supposed to be disabled when Xrender support is being enabled + // (and used), it really wasn't. Historically, + // UseImageOffscreenSurfaces() was always false in GTK2 builds, thus + // triggering the check, regardless of UseXRender(). + // Some time later, offscreen surfaces were always enabled, but the + // Xrender functionality broke due to not using Xlib-based surfaces. + // Using Xlib-based surfaces compatible with Xrender operations seems + // to lead to weird graphical artifacts (bars and stripes) on some + // hardware (Intel-based?) when displaying quickly-changing content, + // so contrary to the statement above we'd better enable double + // buffering - which also seems to not have any negative performance + // impact. if (!gfxPlatformGtk::GetPlatform()->UseImageOffscreenSurfaces() || - !gfxVars::UseXRender()) + gfxVars::UseXRender()) #endif { useDoubleBuffering = (LayerManagerComposite::SupportsDirectTexturing() &&