Bug 950312 - Part 7: Disable component alpha for layers with a mix-blend-mode. r=roc

This commit is contained in:
Matt Woodrow 2014-05-09 22:06:20 +12:00
Родитель f05c7aef5f
Коммит 3366917b4e
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1007,6 +1007,7 @@ ContainerLayer::DefaultComputeSupportsComponentAlphaChildren(bool* aNeedsSurface
{
bool supportsComponentAlphaChildren = false;
bool needsSurfaceCopy = false;
CompositionOp blendMode = GetEffectiveMixBlendMode();
if (UseIntermediateSurface()) {
if (GetEffectiveVisibleRegion().GetNumRects() == 1 &&
(GetContentFlags() & Layer::CONTENT_OPAQUE))
@ -1016,12 +1017,13 @@ ContainerLayer::DefaultComputeSupportsComponentAlphaChildren(bool* aNeedsSurface
gfx::Matrix transform;
if (HasOpaqueAncestorLayer(this) &&
GetEffectiveTransform().Is2D(&transform) &&
!gfx::ThebesMatrix(transform).HasNonIntegerTranslation()) {
!gfx::ThebesMatrix(transform).HasNonIntegerTranslation() &&
blendMode == gfx::CompositionOp::OP_OVER) {
supportsComponentAlphaChildren = true;
needsSurfaceCopy = true;
}
}
} else {
} else if (blendMode == gfx::CompositionOp::OP_OVER) {
supportsComponentAlphaChildren =
(GetContentFlags() & Layer::CONTENT_OPAQUE) ||
(GetParent() && GetParent()->SupportsComponentAlphaChildren());