mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1073290. Don't render with displayports if we're not painting to the window. r=mattwoodrow
--HG-- extra : rebase_source : 088b2156069248ac920d1a525d069b9a7330f980
This commit is contained in:
parent
dad47aa61f
commit
2d4b87dc16
@ -3791,11 +3791,18 @@ nsDisplaySubDocument::ComputeFrameMetrics(Layer* aLayer,
|
||||
false, isRootContentDocument, params));
|
||||
}
|
||||
|
||||
static bool
|
||||
UseDisplayPortForViewport(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||
nsRect* aDisplayPort = nullptr)
|
||||
{
|
||||
return aBuilder->IsPaintingToWindow() &&
|
||||
nsLayoutUtils::ViewportHasDisplayPort(aFrame->PresContext(), aDisplayPort);
|
||||
}
|
||||
|
||||
nsRect
|
||||
nsDisplaySubDocument::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
|
||||
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) && usingDisplayPort) {
|
||||
*aSnap = false;
|
||||
@ -3810,8 +3817,7 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||
nsRegion* aVisibleRegion)
|
||||
{
|
||||
nsRect displayport;
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext(), &displayport);
|
||||
bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame, &displayport);
|
||||
|
||||
if (!(mFlags & GENERATE_SCROLLABLE_LAYER) || !usingDisplayPort) {
|
||||
return nsDisplayWrapList::ComputeVisibility(aBuilder, aVisibleRegion);
|
||||
@ -3847,8 +3853,7 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||
bool
|
||||
nsDisplaySubDocument::ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
|
||||
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) && usingDisplayPort) {
|
||||
return true;
|
||||
@ -3860,8 +3865,7 @@ nsDisplaySubDocument::ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBui
|
||||
nsRegion
|
||||
nsDisplaySubDocument::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
|
||||
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) && usingDisplayPort) {
|
||||
*aSnap = false;
|
||||
@ -4426,8 +4430,7 @@ bool nsDisplayZoom::ComputeVisibility(nsDisplayListBuilder *aBuilder,
|
||||
// If we are to generate a scrollable layer we call
|
||||
// nsDisplaySubDocument::ComputeVisibility to make the necessary adjustments
|
||||
// for ComputeVisibility, it does all it's calculations in the child APD.
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
bool usingDisplayPort = UseDisplayPortForViewport(aBuilder, mFrame);
|
||||
if (!(mFlags & GENERATE_SCROLLABLE_LAYER) || !usingDisplayPort) {
|
||||
retval =
|
||||
mList.ComputeVisibilityForSublist(aBuilder, &visibleRegion,
|
||||
|
@ -2861,7 +2861,8 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
|
||||
nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame();
|
||||
bool usingDisplayPort = false;
|
||||
nsRect displayport;
|
||||
if (rootScrollFrame && !aFrame->GetParent()) {
|
||||
if (rootScrollFrame && !aFrame->GetParent() &&
|
||||
(aFlags & (PAINT_WIDGET_LAYERS | PAINT_TO_WINDOW))) {
|
||||
nsRect displayportBase(
|
||||
nsPoint(0,0),
|
||||
nsLayoutUtils::CalculateCompositionSizeForFrame(rootScrollFrame));
|
||||
|
@ -2796,7 +2796,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// If we are a root scroll frame that has a display port we want to add
|
||||
// scrollbars, they will be children of the scrollable layer, but they get
|
||||
// adjusted by the APZC automatically.
|
||||
bool usingDisplayPort = nsLayoutUtils::GetDisplayPort(mOuter->GetContent());
|
||||
bool usingDisplayPort = aBuilder->IsPaintingToWindow() &&
|
||||
nsLayoutUtils::GetDisplayPort(mOuter->GetContent());
|
||||
bool addScrollBars = mIsRoot && usingDisplayPort && !aBuilder->IsForEventDelivery();
|
||||
|
||||
if (addScrollBars) {
|
||||
@ -2832,7 +2833,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsRect displayPort;
|
||||
bool usingDisplayport = false;
|
||||
if (!aBuilder->IsForEventDelivery()) {
|
||||
if (aBuilder->IsPaintingToWindow()) {
|
||||
if (!mIsRoot) {
|
||||
// For a non-root scroll frame, override the value of the display port
|
||||
// base rect, and possibly create a display port if there isn't one
|
||||
|
@ -408,7 +408,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
nsRect(nsPoint(0,0), nsLayoutUtils::CalculateCompositionSizeForFrame(rootScrollFrame)) :
|
||||
dirty.Intersect(nsRect(nsPoint(0,0), subdocRootFrame->GetSize()));
|
||||
nsRect displayPort;
|
||||
if (!aBuilder->IsForEventDelivery() &&
|
||||
if (aBuilder->IsPaintingToWindow() &&
|
||||
nsLayoutUtils::GetOrMaybeCreateDisplayPort(
|
||||
*aBuilder, rootScrollFrame, displayportBase, &displayPort)) {
|
||||
haveDisplayPort = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user