Bug 1156401 - Fix painting when building fennec with apzc. r=kats, r=botond
authorDanilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
Thu, 30 Apr 2015 06:08:00 -0400
changeset 271841 cbc880a746c6fde122c8c66bb8ab6bc91129a65d
parent 271840 ca3c11c3b0bff67b226e126fc48b9412cf88bdc8
child 271842 d4b430ab9d27aaff59b75aec4d52a947736c62e6
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, botond
bugs1156401
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1156401 - Fix painting when building fennec with apzc. r=kats, r=botond Since SetFirstPaintViewport wasn't being called on Fennec with APZ, none of the painted content was being displayed.
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -601,16 +601,27 @@ AsyncCompositionManager::ApplyAsyncConte
     }
 
     const FrameMetrics& metrics = aLayer->GetFrameMetrics(i);
     ScreenPoint offset(0, 0);
     // TODO: When we enable APZ on Fennec, we'll need to call SyncFrameMetrics here.
     // When doing so, it might be useful to look at how it was called here before
     // bug 1036967 removed the (dead) call.
 
+#if defined(MOZ_ANDROID_APZ)
+    if (mIsFirstPaint) {
+      CSSToLayerScale geckoZoom = metrics.LayersPixelsPerCSSPixel().ToScaleFactor();
+      LayerIntPoint scrollOffsetLayerPixels = RoundedToInt(metrics.GetScrollOffset() * geckoZoom);
+      mContentRect = metrics.GetScrollableRect();
+      SetFirstPaintViewport(scrollOffsetLayerPixels,
+                            geckoZoom,
+                            mContentRect);
+    }
+#endif
+
     mIsFirstPaint = false;
     mLayersUpdated = false;
 
     // Apply the render offset
     mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
 
     combinedAsyncTransformWithoutOverscroll *= asyncTransformWithoutOverscroll;
     combinedAsyncTransform *= (Matrix4x4(asyncTransformWithoutOverscroll) * overscrollTransform);