mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 900133 - Support MaskLayers that are backed by a NewTextureHost. r=nical
This commit is contained in:
parent
d96bf88ffc
commit
77b9490231
@ -93,6 +93,8 @@ CanvasLayerComposite::RenderLayer(const nsIntPoint& aOffset,
|
||||
gfx::Point(aOffset.x, aOffset.y),
|
||||
gfx::ToFilter(filter),
|
||||
clipRect);
|
||||
|
||||
LayerManagerComposite::RemoveMaskEffect(mMaskLayer);
|
||||
}
|
||||
|
||||
CompositableHost*
|
||||
|
@ -40,6 +40,7 @@ ColorLayerComposite::RenderLayer(const nsIntPoint& aOffset,
|
||||
rect, clipRect,
|
||||
transform, gfx::Point(aOffset.x, aOffset.y));
|
||||
|
||||
LayerManagerComposite::RemoveMaskEffect(GetMaskLayer());
|
||||
}
|
||||
|
||||
} /* layers */
|
||||
|
@ -104,7 +104,18 @@ CompositableHost::AddMaskEffect(EffectChain& aEffects,
|
||||
const gfx::Matrix4x4& aTransform,
|
||||
bool aIs3D)
|
||||
{
|
||||
RefPtr<TextureSource> source = GetDeprecatedTextureHost();
|
||||
RefPtr<TextureSource> source;
|
||||
RefPtr<DeprecatedTextureHost> oldHost = GetDeprecatedTextureHost();
|
||||
if (oldHost) {
|
||||
oldHost->Lock();
|
||||
source = oldHost;
|
||||
} else {
|
||||
RefPtr<TextureHost> host = GetTextureHost();
|
||||
if (host) {
|
||||
host->Lock();
|
||||
source = host->GetTextureSources();
|
||||
}
|
||||
}
|
||||
|
||||
if (!source) {
|
||||
NS_WARNING("Using compositable with no texture host as mask layer");
|
||||
@ -119,6 +130,20 @@ CompositableHost::AddMaskEffect(EffectChain& aEffects,
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
CompositableHost::RemoveMaskEffect()
|
||||
{
|
||||
RefPtr<DeprecatedTextureHost> oldHost = GetDeprecatedTextureHost();
|
||||
if (oldHost) {
|
||||
oldHost->Unlock();
|
||||
} else {
|
||||
RefPtr<TextureHost> host = GetTextureHost();
|
||||
if (host) {
|
||||
host->Unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ TemporaryRef<CompositableHost>
|
||||
CompositableHost::Create(const TextureInfo& aTextureInfo)
|
||||
{
|
||||
|
@ -172,6 +172,8 @@ public:
|
||||
const gfx::Matrix4x4& aTransform,
|
||||
bool aIs3D = false);
|
||||
|
||||
void RemoveMaskEffect();
|
||||
|
||||
Compositor* GetCompositor() const
|
||||
{
|
||||
return mCompositor;
|
||||
|
@ -163,6 +163,8 @@ ContainerRender(ContainerT* aContainer,
|
||||
rect, clipRect,
|
||||
transform, gfx::Point(aOffset.x, aOffset.y));
|
||||
}
|
||||
|
||||
LayerManagerComposite::RemoveMaskEffect(aContainer->GetMaskLayer());
|
||||
}
|
||||
|
||||
ContainerLayerComposite::ContainerLayerComposite(LayerManagerComposite *aManager)
|
||||
|
@ -96,6 +96,8 @@ ImageLayerComposite::RenderLayer(const nsIntPoint& aOffset,
|
||||
gfx::Point(aOffset.x, aOffset.y),
|
||||
gfx::ToFilter(mFilter),
|
||||
clipRect);
|
||||
|
||||
LayerManagerComposite::RemoveMaskEffect(mMaskLayer);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -661,6 +661,21 @@ LayerManagerComposite::AddMaskEffect(Layer* aMaskLayer, EffectChain& aEffects, b
|
||||
return maskLayerComposite->GetCompositableHost()->AddMaskEffect(aEffects, transform, aIs3D);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
LayerManagerComposite::RemoveMaskEffect(Layer* aMaskLayer)
|
||||
{
|
||||
if (!aMaskLayer) {
|
||||
return;
|
||||
}
|
||||
LayerComposite* maskLayerComposite = static_cast<LayerComposite*>(aMaskLayer->ImplData());
|
||||
if (!maskLayerComposite->GetCompositableHost()) {
|
||||
NS_WARNING("Mask layer with no compositable host");
|
||||
return;
|
||||
}
|
||||
|
||||
maskLayerComposite->GetCompositableHost()->RemoveMaskEffect();
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
LayerManagerComposite::CreateDrawTarget(const IntSize &aSize,
|
||||
SurfaceFormat aFormat)
|
||||
|
@ -165,6 +165,8 @@ public:
|
||||
EffectChain& aEffect,
|
||||
bool aIs3D = false);
|
||||
|
||||
static void RemoveMaskEffect(Layer* aMaskLayer);
|
||||
|
||||
/**
|
||||
* Creates a DrawTarget which is optimized for inter-operating with this
|
||||
* layermanager.
|
||||
|
@ -140,6 +140,7 @@ ThebesLayerComposite::RenderLayer(const nsIntPoint& aOffset,
|
||||
mValidRegion = tiledLayerProps.mValidRegion;
|
||||
}
|
||||
|
||||
LayerManagerComposite::RemoveMaskEffect(mMaskLayer);
|
||||
mCompositeManager->GetCompositor()->MakeCurrent();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user