summaryrefslogtreecommitdiffstats
path: root/gfx/layers/mlgpu/PaintedLayerMLGPU.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/mlgpu/PaintedLayerMLGPU.cpp')
-rw-r--r--gfx/layers/mlgpu/PaintedLayerMLGPU.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/layers/mlgpu/PaintedLayerMLGPU.cpp b/gfx/layers/mlgpu/PaintedLayerMLGPU.cpp
index 6770b64..43b5eda 100644
--- a/gfx/layers/mlgpu/PaintedLayerMLGPU.cpp
+++ b/gfx/layers/mlgpu/PaintedLayerMLGPU.cpp
@@ -65,12 +65,16 @@ bool PaintedLayerMLGPU::SetCompositableHost(CompositableHost* aHost) {
switch (aHost->GetType()) {
case CompositableType::CONTENT_TILED:
case CompositableType::CONTENT_SINGLE:
- case CompositableType::CONTENT_DOUBLE:
+ case CompositableType::CONTENT_DOUBLE: {
+ if (mHost && mHost != aHost->AsContentHost()) {
+ mHost->Detach(this);
+ }
mHost = aHost->AsContentHost();
if (!mHost) {
gfxWarning() << "ContentHostBase is not a ContentHostTexture";
}
return true;
+ }
default:
return false;
}