mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 809273 - Make mUseIntermediateSurface and mSupportsComponentAlpha on BasicShadowableContainerLayers match the compositor. r=roc
This commit is contained in:
parent
f3afacc43a
commit
ae1f55d9ad
@ -87,6 +87,15 @@ public:
|
|||||||
BasicShadowableLayer::Disconnect();
|
BasicShadowableLayer::Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface) MOZ_OVERRIDE
|
||||||
|
{
|
||||||
|
if (HasShadow()) {
|
||||||
|
DefaultComputeEffectiveTransforms(aTransformToSurface);
|
||||||
|
} else {
|
||||||
|
BasicContainerLayer::ComputeEffectiveTransforms(aTransformToSurface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicShadowLayerManager* ShadowManager()
|
BasicShadowLayerManager* ShadowManager()
|
||||||
{
|
{
|
||||||
|
@ -234,6 +234,8 @@ public:
|
|||||||
|
|
||||||
void ForceIntermediateSurface() { mUseIntermediateSurface = true; }
|
void ForceIntermediateSurface() { mUseIntermediateSurface = true; }
|
||||||
|
|
||||||
|
void SetSupportsComponentAlphaChildren(bool aSupports) { mSupportsComponentAlphaChildren = aSupports; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BasicLayerManager* BasicManager()
|
BasicLayerManager* BasicManager()
|
||||||
{
|
{
|
||||||
|
@ -873,6 +873,16 @@ BasicLayerManager::FlushGroup(PaintLayerContext& aPaintContext, bool aNeedsClipT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
HasOpaqueAncestorLayer(Layer* aLayer)
|
||||||
|
{
|
||||||
|
for (Layer* l = aLayer->GetParent(); l; l = l->GetParent()) {
|
||||||
|
if (l->GetContentFlags() & Layer::CONTENT_OPAQUE)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||||
Layer* aLayer,
|
Layer* aLayer,
|
||||||
@ -907,6 +917,28 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
|||||||
container->UseIntermediateSurface(),
|
container->UseIntermediateSurface(),
|
||||||
"ContainerLayer with mask layer should force UseIntermediateSurface");
|
"ContainerLayer with mask layer should force UseIntermediateSurface");
|
||||||
|
|
||||||
|
// If we're a shadowable ContainerLayer, then setup mSupportsComponentAlphaChildren
|
||||||
|
// in the same way that ContainerLayerComposite will do. Otherwise leave it set to
|
||||||
|
// true.
|
||||||
|
ShadowableLayer* shadow = aLayer->AsShadowableLayer();
|
||||||
|
if (aLayer->GetFirstChild() && shadow && shadow->HasShadow()) {
|
||||||
|
if (needsGroup) {
|
||||||
|
if (container->GetEffectiveVisibleRegion().GetNumRects() != 1 ||
|
||||||
|
!(container->GetContentFlags() & Layer::CONTENT_OPAQUE))
|
||||||
|
{
|
||||||
|
const gfx3DMatrix& transform3D = container->GetEffectiveTransform();
|
||||||
|
gfxMatrix transform;
|
||||||
|
if (HasOpaqueAncestorLayer(container) &&
|
||||||
|
transform3D.Is2D(&transform) && !transform.HasNonIntegerTranslation()) {
|
||||||
|
container->SetSupportsComponentAlphaChildren(gfxPlatform::GetPlatform()->UsesSubpixelAATextRendering());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
container->SetSupportsComponentAlphaChildren((container->GetContentFlags() & Layer::CONTENT_OPAQUE) ||
|
||||||
|
(container->GetParent() && container->GetParent()->SupportsComponentAlphaChildren()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gfxContextAutoSaveRestore contextSR;
|
gfxContextAutoSaveRestore contextSR;
|
||||||
gfxMatrix transform;
|
gfxMatrix transform;
|
||||||
// Will return an identity matrix for 3d transforms, and is handled separately below.
|
// Will return an identity matrix for 3d transforms, and is handled separately below.
|
||||||
|
Loading…
Reference in New Issue
Block a user