From dd55277c3e3d12f4240b6e564b66f31465b42d0d Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 2 Oct 2012 22:55:50 -0700 Subject: [PATCH] Bug 790505, part 1: Have prerendered transform frames pretend that they don't have an opaque region so that we can move them around more efficiently. r=mattwoodrow --- layout/base/nsDisplayList.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 8950a74498c..7f526c1a449 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3928,7 +3928,14 @@ nsRegion nsDisplayTransform::GetOpaqueRegion(nsDisplayListBuilder *aBuilder, *aSnap = false; nsRect untransformedVisible; float factor = nsPresContext::AppUnitsPerCSSPixel(); - if (!UntransformRectMatrix(mVisibleRect, GetTransform(factor), factor, &untransformedVisible)) { + // If we're going to prerender all our content, pretend like we + // don't have opqaue content so that everything under us is rendered + // as well. That will increase graphics memory usage if our frame + // covers the entire window, but it allows our transform to be + // updated extremely cheaply, without invalidating any other + // content. + if (ShouldPrerenderTransformedContent(aBuilder, mFrame) || + !UntransformRectMatrix(mVisibleRect, GetTransform(factor), factor, &untransformedVisible)) { return nsRegion(); }