Bug 1022612. Part 42: Add opaque regions of ThebesLayer content to the "exclude glass" region. r=mattwoodrow

--HG--
extra : rebase_source : 715df6c86b139aec7ad607e56c89dbfad3475380
This commit is contained in:
Robert O'Callahan 2014-07-14 12:46:13 +12:00
parent 6cd2fbb7d6
commit 4465fecb8a
2 changed files with 11 additions and 1 deletions

View File

@ -2600,6 +2600,12 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem,
opaqueClipped.Contains(mContainerBounds)) {
aList->SetIsOpaque();
}
// 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);
}
opaquePixels = ScaleRegionToInsidePixels(opaqueClipped, snapOpaque);
if (aFixedPosFrame && ItemCoversScrollableArea(aItem, opaque)) {
*aHideAllLayersBelow = true;

View File

@ -667,7 +667,7 @@ public:
* -moz-win-exclude-glass style. Used in setting glass margins on
* Windows.
*/
void AddExcludedGlassRegion(nsRect &bounds) {
void AddExcludedGlassRegion(const nsRegion& bounds) {
mExcludedGlassRegion.Or(mExcludedGlassRegion, bounds);
}
const nsRegion& GetExcludedGlassRegion() {
@ -684,6 +684,10 @@ public:
mGlassDisplayItem = aItem;
}
}
// Call this only after we've finished building the display list
bool HasGlass() {
return mGlassDisplayItem != nullptr;
}
bool NeedToForceTransparentSurfaceForItem(nsDisplayItem* aItem) {
return aItem == mGlassDisplayItem;
}