зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1538736 - Make extra sure Compositables don't refer back to layers after reassignment. r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D27930 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7ec9b68802
Коммит
546c396de9
|
@ -40,9 +40,13 @@ CanvasLayerComposite::~CanvasLayerComposite() {
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -47,9 +47,14 @@ ImageLayerComposite::~ImageLayerComposite() {
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -47,9 +47,14 @@ bool 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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче