mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 17:47:34 +09:00
Make extra sure Compositables don't refer back to layers after reassignment.
This commit is contained in:
parent
8ad58ee574
commit
706ac5f0a4
3 changed files with 19 additions and 5 deletions
|
|
@ -43,9 +43,13 @@ bool
|
||||||
CanvasLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
CanvasLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||||
{
|
{
|
||||||
switch (aHost->GetType()) {
|
switch (aHost->GetType()) {
|
||||||
case CompositableType::IMAGE:
|
case CompositableType::IMAGE: {
|
||||||
|
if (mCompositableHost && aHost != mCompositableHost) {
|
||||||
|
mCompositableHost->Detach(this);
|
||||||
|
}
|
||||||
mCompositableHost = aHost;
|
mCompositableHost = aHost;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,14 @@ bool
|
||||||
ImageLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
ImageLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||||
{
|
{
|
||||||
switch (aHost->GetType()) {
|
switch (aHost->GetType()) {
|
||||||
case CompositableType::IMAGE:
|
case CompositableType::IMAGE: {
|
||||||
mImageHost = static_cast<ImageHost*>(aHost);
|
ImageHost* newImageHost = static_cast<ImageHost*>(aHost);
|
||||||
|
if (mImageHost && newImageHost != mImageHost) {
|
||||||
|
mImageHost->Detach(this);
|
||||||
|
}
|
||||||
|
mImageHost = newImageHost;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,14 @@ PaintedLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||||
switch (aHost->GetType()) {
|
switch (aHost->GetType()) {
|
||||||
case CompositableType::CONTENT_TILED:
|
case CompositableType::CONTENT_TILED:
|
||||||
case CompositableType::CONTENT_SINGLE:
|
case CompositableType::CONTENT_SINGLE:
|
||||||
case CompositableType::CONTENT_DOUBLE:
|
case CompositableType::CONTENT_DOUBLE: {
|
||||||
mBuffer = static_cast<ContentHost*>(aHost);
|
ContentHost* newBuffer = static_cast<ContentHost*>(aHost);
|
||||||
|
if (mBuffer && newBuffer != mBuffer) {
|
||||||
|
mBuffer->Detach(this);
|
||||||
|
}
|
||||||
|
mBuffer = newBuffer;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue