summaryrefslogtreecommitdiffstats
path: root/gfx/layers
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-04 18:21:04 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-04 18:21:04 +0200
commitdee00a8a79394559e0e868cc72464c2de24583ac (patch)
tree18dc2e3db8127ceabcf9b03416b135bced2976ad /gfx/layers
parent851cfd198bc01020cd411d4f1cd6586222700269 (diff)
parent363bfeb2c06e5f57136ebdab8da1ebeba0591520 (diff)
downloadUXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar
UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.gz
UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.lz
UXP-dee00a8a79394559e0e868cc72464c2de24583ac.tar.xz
UXP-dee00a8a79394559e0e868cc72464c2de24583ac.zip
Merge branch 'master' into Basilisk-release
Diffstat (limited to 'gfx/layers')
-rw-r--r--gfx/layers/client/ContentClient.cpp15
-rw-r--r--gfx/layers/composite/CanvasLayerComposite.cpp6
-rw-r--r--gfx/layers/composite/ImageLayerComposite.cpp9
-rw-r--r--gfx/layers/composite/PaintedLayerComposite.cpp9
4 files changed, 33 insertions, 6 deletions
diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp
index 3373230a9..50e159a23 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() &&
diff --git a/gfx/layers/composite/CanvasLayerComposite.cpp b/gfx/layers/composite/CanvasLayerComposite.cpp
index 3c8299e05..86f25b1ee 100644
--- a/gfx/layers/composite/CanvasLayerComposite.cpp
+++ b/gfx/layers/composite/CanvasLayerComposite.cpp
@@ -43,9 +43,13 @@ bool
CanvasLayerComposite::SetCompositableHost(CompositableHost* aHost)
{
switch (aHost->GetType()) {
- case CompositableType::IMAGE:
+ case CompositableType::IMAGE: {
+ if (mCompositableHost && aHost != mCompositableHost) {
+ mCompositableHost->Detach(this);
+ }
mCompositableHost = aHost;
return true;
+ }
default:
return false;
}
diff --git a/gfx/layers/composite/ImageLayerComposite.cpp b/gfx/layers/composite/ImageLayerComposite.cpp
index bac9f3790..6867aaa22 100644
--- a/gfx/layers/composite/ImageLayerComposite.cpp
+++ b/gfx/layers/composite/ImageLayerComposite.cpp
@@ -50,9 +50,14 @@ bool
ImageLayerComposite::SetCompositableHost(CompositableHost* aHost)
{
switch (aHost->GetType()) {
- case CompositableType::IMAGE:
- mImageHost = static_cast<ImageHost*>(aHost);
+ case CompositableType::IMAGE: {
+ ImageHost* newImageHost = static_cast<ImageHost*>(aHost);
+ if (mImageHost && newImageHost != mImageHost) {
+ mImageHost->Detach(this);
+ }
+ mImageHost = newImageHost;
return true;
+ }
default:
return false;
}
diff --git a/gfx/layers/composite/PaintedLayerComposite.cpp b/gfx/layers/composite/PaintedLayerComposite.cpp
index b58f5d690..232cc4ef4 100644
--- a/gfx/layers/composite/PaintedLayerComposite.cpp
+++ b/gfx/layers/composite/PaintedLayerComposite.cpp
@@ -49,9 +49,14 @@ PaintedLayerComposite::SetCompositableHost(CompositableHost* aHost)
switch (aHost->GetType()) {
case CompositableType::CONTENT_TILED:
case CompositableType::CONTENT_SINGLE:
- case CompositableType::CONTENT_DOUBLE:
- mBuffer = static_cast<ContentHost*>(aHost);
+ case CompositableType::CONTENT_DOUBLE: {
+ ContentHost* newBuffer = static_cast<ContentHost*>(aHost);
+ if (mBuffer && newBuffer != mBuffer) {
+ mBuffer->Detach(this);
+ }
+ mBuffer = newBuffer;
return true;
+ }
default:
return false;
}