Bug 1022612. Part 43: Fix up SuppressComponentAlpha to allow component alpha in inactive layers over opaque parts of the chrome window. r=mattwoodrow
This commit is contained in:
@@ -2212,21 +2212,22 @@ ContainerState::PopThebesLayerData()
|
||||
}
|
||||
|
||||
static bool
|
||||
SuppressComponentAlpha(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayItem* aItem)
|
||||
IsItemAreaInWindowOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayItem* aItem,
|
||||
const nsRect& aComponentAlphaBounds)
|
||||
{
|
||||
// Suppress component alpha for items in the toplevel window chrome that
|
||||
// aren't transformed.
|
||||
nsIFrame* f = aItem->Frame();
|
||||
nsIFrame* ref = aBuilder->RootReferenceFrame();
|
||||
if (f->PresContext() != ref->PresContext())
|
||||
return false;
|
||||
|
||||
for (nsIFrame* t = f; t; t = t->GetParent()) {
|
||||
if (t->IsTransformed())
|
||||
return false;
|
||||
if (!aItem->Frame()->PresContext()->IsChrome()) {
|
||||
// Assume that Web content is always in the window opaque region.
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
if (aItem->ReferenceFrame() != aBuilder->RootReferenceFrame()) {
|
||||
// aItem is probably in some transformed subtree.
|
||||
// We're not going to bother figuring out where this landed, we're just
|
||||
// going to assume it might have landed over a transparent part of
|
||||
// the window.
|
||||
return false;
|
||||
}
|
||||
return aBuilder->GetWindowOpaqueRegion().Contains(aComponentAlphaBounds);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2338,10 +2339,11 @@ ThebesLayerData::Accumulate(ContainerState* aState,
|
||||
nsIntRect componentAlphaRect =
|
||||
aState->ScaleToOutsidePixels(componentAlpha, false).Intersect(aVisibleRect);
|
||||
if (!mOpaqueRegion.Contains(componentAlphaRect)) {
|
||||
if (SuppressComponentAlpha(aState->mBuilder, aItem)) {
|
||||
aItem->DisableComponentAlpha();
|
||||
} else {
|
||||
if (IsItemAreaInWindowOpaqueRegion(aState->mBuilder, aItem,
|
||||
componentAlpha.Intersect(aItem->GetVisibleRect()))) {
|
||||
mNeedComponentAlpha = true;
|
||||
} else {
|
||||
aItem->DisableComponentAlpha();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2603,8 +2605,8 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem,
|
||||
// Add opaque areas to the "exclude glass" region. Only do this for
|
||||
// ThebesLayers which are direct children of the root layer; this means
|
||||
// they can't have transforms or opacity wrapping them.
|
||||
if (!mContainerLayer->GetParent() && mBuilder->HasGlass()) {
|
||||
mBuilder->AddExcludedGlassRegion(opaqueClipped);
|
||||
if (!mContainerLayer->GetParent()) {
|
||||
mBuilder->AddWindowOpaqueRegion(opaqueClipped);
|
||||
}
|
||||
opaquePixels = ScaleRegionToInsidePixels(opaqueClipped, snapOpaque);
|
||||
if (aFixedPosFrame && ItemCoversScrollableArea(aItem, opaque)) {
|
||||
|
||||
Reference in New Issue
Block a user