mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 10:50:35 +00:00
Bug 966528 - Use a specific IPDL message for component alpha. r=mattwoodrow
This commit is contained in:
parent
10cf13f470
commit
84a35dc66a
@ -293,9 +293,11 @@ ContentClientRemoteBuffer::Updated(const nsIntRegion& aRegionToDraw,
|
||||
aDidSelfCopy);
|
||||
|
||||
MOZ_ASSERT(mTextureClient);
|
||||
mForwarder->UseTexture(this, mTextureClient);
|
||||
if (mTextureClientOnWhite) {
|
||||
mForwarder->UseTexture(this, mTextureClientOnWhite);
|
||||
mForwarder->UseComponentAlphaTextures(this, mTextureClient,
|
||||
mTextureClientOnWhite);
|
||||
} else {
|
||||
mForwarder->UseTexture(this, mTextureClient);
|
||||
}
|
||||
mForwarder->UpdateTextureRegion(this,
|
||||
ThebesBufferData(BufferRect(),
|
||||
|
@ -109,6 +109,7 @@ public:
|
||||
// call before and after painting into this content client
|
||||
virtual void BeginPaint() {}
|
||||
virtual void EndPaint() {}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -48,6 +48,17 @@ CompositableHost::UseTextureHost(TextureHost* aTexture)
|
||||
aTexture->SetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
|
||||
}
|
||||
|
||||
void
|
||||
CompositableHost::UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
||||
TextureHost* aTextureOnWhite)
|
||||
{
|
||||
MOZ_ASSERT(aTextureOnBlack && aTextureOnWhite);
|
||||
aTextureOnBlack->SetCompositor(GetCompositor());
|
||||
aTextureOnBlack->SetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
|
||||
aTextureOnWhite->SetCompositor(GetCompositor());
|
||||
aTextureOnWhite->SetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
|
||||
}
|
||||
|
||||
void
|
||||
CompositableHost::SetCompositor(Compositor* aCompositor)
|
||||
{
|
||||
|
@ -288,6 +288,8 @@ public:
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix) { }
|
||||
|
||||
virtual void UseTextureHost(TextureHost* aTexture);
|
||||
virtual void UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
||||
TextureHost* aTextureOnWhite);
|
||||
|
||||
protected:
|
||||
TextureInfo mTextureInfo;
|
||||
|
@ -220,13 +220,18 @@ ContentHostBase::Composite(EffectChain& aEffectChain,
|
||||
void
|
||||
ContentHostBase::UseTextureHost(TextureHost* aTexture)
|
||||
{
|
||||
if (aTexture->GetFlags() & TEXTURE_ON_WHITE) {
|
||||
mTextureHostOnWhite = aTexture;
|
||||
mTextureHostOnWhite->SetCompositor(GetCompositor());
|
||||
} else {
|
||||
mTextureHost = aTexture;
|
||||
mTextureHost->SetCompositor(GetCompositor());
|
||||
}
|
||||
mTextureHost = aTexture;
|
||||
mTextureHostOnWhite = nullptr;
|
||||
mTextureHost->SetCompositor(GetCompositor());
|
||||
}
|
||||
|
||||
void
|
||||
ContentHostBase::UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
||||
TextureHost* aTextureOnWhite)
|
||||
{
|
||||
CompositableHost::UseComponentAlphaTextures(aTextureOnBlack, aTextureOnWhite);
|
||||
mTextureHost = aTextureOnBlack;
|
||||
mTextureHostOnWhite = aTextureOnWhite;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -116,6 +116,8 @@ public:
|
||||
virtual TextureHost* GetAsTextureHost() MOZ_OVERRIDE;
|
||||
|
||||
virtual void UseTextureHost(TextureHost* aTexture) MOZ_OVERRIDE;
|
||||
virtual void UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
||||
TextureHost* aTextureOnWhite) MOZ_OVERRIDE;
|
||||
|
||||
virtual void SetPaintWillResample(bool aResample) { mPaintWillResample = aResample; }
|
||||
|
||||
|
@ -190,6 +190,9 @@ public:
|
||||
*/
|
||||
virtual void UseTexture(CompositableClient* aCompositable,
|
||||
TextureClient* aClient) = 0;
|
||||
virtual void UseComponentAlphaTextures(CompositableClient* aCompositable,
|
||||
TextureClient* aClientOnBlack,
|
||||
TextureClient* aClientOnWhite) = 0;
|
||||
|
||||
/**
|
||||
* Tell the compositor side that the shared data has been modified so that
|
||||
|
@ -233,6 +233,20 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpUseComponentAlphaTextures: {
|
||||
const OpUseComponentAlphaTextures& op = aEdit.get_OpUseComponentAlphaTextures();
|
||||
CompositableHost* compositable = AsCompositable(op);
|
||||
RefPtr<TextureHost> texOnBlack = TextureHost::AsTextureHost(op.textureOnBlackParent());
|
||||
RefPtr<TextureHost> texOnWhite = TextureHost::AsTextureHost(op.textureOnWhiteParent());
|
||||
|
||||
MOZ_ASSERT(texOnBlack && texOnWhite);
|
||||
compositable->UseComponentAlphaTextures(texOnBlack, texOnWhite);
|
||||
|
||||
if (IsAsync()) {
|
||||
ScheduleComposition(op);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpUpdateTexture: {
|
||||
const OpUpdateTexture& op = aEdit.get_OpUpdateTexture();
|
||||
RefPtr<TextureHost> texture = TextureHost::AsTextureHost(op.textureParent());
|
||||
|
@ -114,6 +114,16 @@ ImageBridgeChild::UseTexture(CompositableClient* aCompositable,
|
||||
nullptr, aTexture->GetIPDLActor()));
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::UseComponentAlphaTextures(CompositableClient* aCompositable,
|
||||
TextureClient* aTextureOnBlack,
|
||||
TextureClient* aTextureOnWhite)
|
||||
{
|
||||
mTxn->AddNoSwapEdit(OpUseComponentAlphaTextures(nullptr, aCompositable->GetIPDLActor(),
|
||||
nullptr, aTextureOnBlack->GetIPDLActor(),
|
||||
nullptr, aTextureOnWhite->GetIPDLActor()));
|
||||
}
|
||||
|
||||
void
|
||||
ImageBridgeChild::UpdatedTexture(CompositableClient* aCompositable,
|
||||
TextureClient* aTexture,
|
||||
|
@ -271,6 +271,9 @@ public:
|
||||
*/
|
||||
virtual void UseTexture(CompositableClient* aCompositable,
|
||||
TextureClient* aClient) MOZ_OVERRIDE;
|
||||
virtual void UseComponentAlphaTextures(CompositableClient* aCompositable,
|
||||
TextureClient* aClientOnBlack,
|
||||
TextureClient* aClientOnWhite) MOZ_OVERRIDE;
|
||||
|
||||
virtual void RemoveTexture(TextureClient* aTexture) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -312,6 +312,12 @@ struct OpUseTexture {
|
||||
PTexture texture;
|
||||
};
|
||||
|
||||
struct OpUseComponentAlphaTextures {
|
||||
PCompositable compositable;
|
||||
PTexture textureOnBlack;
|
||||
PTexture textureOnWhite;
|
||||
};
|
||||
|
||||
union MaybeRegion {
|
||||
nsIntRegion;
|
||||
null_t;
|
||||
@ -338,6 +344,7 @@ union CompositableOperation {
|
||||
|
||||
OpUpdateTexture;
|
||||
OpUseTexture;
|
||||
OpUseComponentAlphaTextures;
|
||||
};
|
||||
|
||||
// A unit of a changeset; a set of these comprise a changeset
|
||||
|
@ -435,6 +435,16 @@ ShadowLayerForwarder::UseTexture(CompositableClient* aCompositable,
|
||||
nullptr, aTexture->GetIPDLActor()));
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::UseComponentAlphaTextures(CompositableClient* aCompositable,
|
||||
TextureClient* aTextureOnBlack,
|
||||
TextureClient* aTextureOnWhite)
|
||||
{
|
||||
mTxn->AddEdit(OpUseComponentAlphaTextures(nullptr, aCompositable->GetIPDLActor(),
|
||||
nullptr, aTextureOnBlack->GetIPDLActor(),
|
||||
nullptr, aTextureOnWhite->GetIPDLActor()));
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::RemoveTexture(TextureClient* aTexture)
|
||||
{
|
||||
|
@ -321,6 +321,9 @@ public:
|
||||
*/
|
||||
virtual void UseTexture(CompositableClient* aCompositable,
|
||||
TextureClient* aClient) MOZ_OVERRIDE;
|
||||
virtual void UseComponentAlphaTextures(CompositableClient* aCompositable,
|
||||
TextureClient* aClientOnBlack,
|
||||
TextureClient* aClientOnWhite) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* End the current transaction and forward it to LayerManagerComposite.
|
||||
|
Loading…
Reference in New Issue
Block a user