зеркало из https://github.com/mozilla/gecko-dev.git
Require mix-blend mode support in all compositors and layer managers. (bug 1209278 part 1, r=mstange)
--HG-- extra : rebase_source : c63182aa6b4465e22d8d4147bfd40bc1e8183b08
This commit is contained in:
Родитель
241addc752
Коммит
a08042eef1
|
@ -783,7 +783,6 @@ struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
|
|||
static void Write(Message* aMsg, const paramType& aParam)
|
||||
{
|
||||
WriteParam(aMsg, aParam.mParentBackend);
|
||||
WriteParam(aMsg, aParam.mSupportedBlendModes.serialize());
|
||||
WriteParam(aMsg, aParam.mMaxTextureSize);
|
||||
WriteParam(aMsg, aParam.mSupportsTextureBlitting);
|
||||
WriteParam(aMsg, aParam.mSupportsPartialUploads);
|
||||
|
@ -792,14 +791,11 @@ struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
|
|||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
uint32_t supportedBlendModes = 0;
|
||||
bool result = ReadParam(aMsg, aIter, &aResult->mParentBackend) &&
|
||||
ReadParam(aMsg, aIter, &supportedBlendModes) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mMaxTextureSize) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mSupportsTextureBlitting) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mSupportsPartialUploads) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mSyncHandle);
|
||||
aResult->mSupportedBlendModes.deserialize(supportedBlendModes);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -161,7 +161,6 @@ struct TextureFactoryIdentifier
|
|||
{
|
||||
LayersBackend mParentBackend;
|
||||
GeckoProcessType mParentProcessId;
|
||||
EnumSet<gfx::CompositionOp> mSupportedBlendModes;
|
||||
int32_t mMaxTextureSize;
|
||||
bool mSupportsTextureBlitting;
|
||||
bool mSupportsPartialUploads;
|
||||
|
@ -175,7 +174,6 @@ struct TextureFactoryIdentifier
|
|||
SyncHandle aSyncHandle = 0)
|
||||
: mParentBackend(aLayersBackend)
|
||||
, mParentProcessId(aParentProcessId)
|
||||
, mSupportedBlendModes(gfx::CompositionOp::OP_OVER)
|
||||
, mMaxTextureSize(aMaxTextureSize)
|
||||
, mSupportsTextureBlitting(aSupportsTextureBlitting)
|
||||
, mSupportsPartialUploads(aSupportsPartialUploads)
|
||||
|
|
|
@ -640,17 +640,6 @@ public:
|
|||
mRegionToClear = aRegion;
|
||||
}
|
||||
|
||||
virtual bool SupportsMixBlendModes(EnumSet<gfx::CompositionOp>& aMixBlendModes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SupportsMixBlendMode(gfx::CompositionOp aMixBlendMode)
|
||||
{
|
||||
EnumSet<gfx::CompositionOp> modes(aMixBlendMode);
|
||||
return SupportsMixBlendModes(modes);
|
||||
}
|
||||
|
||||
virtual float RequestProperty(const nsAString& property) { return -1; }
|
||||
|
||||
const TimeStamp& GetAnimationReadyTime() const {
|
||||
|
|
|
@ -116,11 +116,6 @@ BasicCompositor::GetTextureFactoryIdentifier()
|
|||
TextureFactoryIdentifier ident(LayersBackend::LAYERS_BASIC,
|
||||
XRE_GetProcessType(),
|
||||
GetMaxTextureSize());
|
||||
|
||||
// All composition ops are supported in software.
|
||||
for (uint8_t op = 0; op < uint8_t(CompositionOp::OP_COUNT); op++) {
|
||||
ident.mSupportedBlendModes += CompositionOp(op);
|
||||
}
|
||||
return ident;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,8 +160,6 @@ public:
|
|||
virtual int32_t GetMaxTextureSize() const override { return INT32_MAX; }
|
||||
bool CompositorMightResample() { return mCompositorMightResample; }
|
||||
|
||||
virtual bool SupportsMixBlendModes(EnumSet<gfx::CompositionOp>& aMixBlendModes) override { return true; }
|
||||
|
||||
protected:
|
||||
enum TransactionPhase {
|
||||
PHASE_NONE, PHASE_CONSTRUCTION, PHASE_DRAWING, PHASE_FORWARD
|
||||
|
|
|
@ -202,11 +202,6 @@ public:
|
|||
const mozilla::TimeStamp& aCompositeStart,
|
||||
const mozilla::TimeStamp& aCompositeEnd);
|
||||
|
||||
virtual bool SupportsMixBlendModes(EnumSet<gfx::CompositionOp>& aMixBlendModes) override
|
||||
{
|
||||
return (GetTextureFactoryIdentifier().mSupportedBlendModes & aMixBlendModes) == aMixBlendModes;
|
||||
}
|
||||
|
||||
virtual bool AreComponentAlphaLayersEnabled() override;
|
||||
|
||||
// Log APZ test data for the current paint. We supply the paint sequence
|
||||
|
|
|
@ -461,11 +461,6 @@ CompositorD3D11::GetTextureFactoryIdentifier()
|
|||
ident.mParentProcessId = XRE_GetProcessType();
|
||||
ident.mParentBackend = LayersBackend::LAYERS_D3D11;
|
||||
ident.mSyncHandle = mAttachments->mSyncHandle;
|
||||
for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) {
|
||||
if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) {
|
||||
ident.mSupportedBlendModes += gfx::CompositionOp(op);
|
||||
}
|
||||
}
|
||||
return ident;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,11 +73,6 @@ CompositorD3D9::GetTextureFactoryIdentifier()
|
|||
ident.mMaxTextureSize = GetMaxTextureSize();
|
||||
ident.mParentBackend = LayersBackend::LAYERS_D3D9;
|
||||
ident.mParentProcessId = XRE_GetProcessType();
|
||||
for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) {
|
||||
if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) {
|
||||
ident.mSupportedBlendModes += gfx::CompositionOp(op);
|
||||
}
|
||||
}
|
||||
return ident;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,12 +215,6 @@ public:
|
|||
GetMaxTextureSize(),
|
||||
mFBOTextureTarget == LOCAL_GL_TEXTURE_2D,
|
||||
SupportsPartialTextureUpdate());
|
||||
result.mSupportedBlendModes += gfx::CompositionOp::OP_SOURCE;
|
||||
for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) {
|
||||
if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) {
|
||||
result.mSupportedBlendModes += gfx::CompositionOp(op);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -4322,9 +4322,7 @@ nsDisplayMixBlendMode::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
{
|
||||
CompositionOp op =
|
||||
nsCSSRendering::GetGFXBlendMode(mFrame->StyleDisplay()->mMixBlendMode);
|
||||
return aManager->SupportsMixBlendMode(op)
|
||||
? LAYER_ACTIVE
|
||||
: LAYER_INACTIVE;
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
||||
// nsDisplayMixBlendMode uses layers for rendering
|
||||
|
@ -4428,10 +4426,7 @@ nsDisplayBlendContainer::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aParameters)
|
||||
{
|
||||
if (mCanBeActive && aManager->SupportsMixBlendModes(mContainedBlendModes)) {
|
||||
return mozilla::LAYER_ACTIVE;
|
||||
}
|
||||
return mozilla::LAYER_INACTIVE;
|
||||
return mCanBeActive ? mozilla::LAYER_ACTIVE : mozilla::LAYER_INACTIVE;
|
||||
}
|
||||
|
||||
bool nsDisplayBlendContainer::TryMerge(nsDisplayItem* aItem) {
|
||||
|
@ -4928,9 +4923,7 @@ nsDisplayScrollInfoLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
|
|||
// building, we encountered a mix blend mode. If our layer manager
|
||||
// supports compositing this mix blend mode, we don't actually need to
|
||||
// create a scroll info layer.
|
||||
if (aManager->SupportsMixBlendModes(mContainedBlendModes)) {
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ContainerLayerParameters params = aContainerParameters;
|
||||
|
|
Загрузка…
Ссылка в новой задаче