Bug 748048 - Part 2: Don't restrict invalidation to the widget's boundaries on Android. r=roc
authorAli Juma <ajuma@mozilla.com>
Thu, 03 May 2012 12:34:02 -0400
changeset 92900 5be71aa88a163df3f3de490d737dec12562a3b34
parent 92899 3e391f4c1bcbc8691a3a9f68ff15d90d1091bb59
child 92901 a0356446a56a2e98d5aaf6c12aa3d826408688ee
child 106146 c660397f6ab25e596d6fd1a2ce3eb2ca1b52626f
push id22600
push userajuma@mozilla.com
push dateThu, 03 May 2012 16:34:30 +0000
treeherdermozilla-central@5be71aa88a16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs748048
milestone15.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 748048 - Part 2: Don't restrict invalidation to the widget's boundaries on Android. r=roc
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1014,19 +1014,17 @@ nsWindow::DrawTo(gfxASurface *targetSurf
         if (mChildren[i]->mBounds.Contains(boundsRect)) {
             coveringChildIndex = PRInt32(i);
         }
     }
 
     // If we have no covering child, then we need to render this.
     if (coveringChildIndex == -1) {
         nsPaintEvent event(true, NS_PAINT, this);
-
-        nsIntRect tileRect(0, 0, gAndroidBounds.width, gAndroidBounds.height);
-        event.region = boundsRect.Intersect(invalidRect).Intersect(tileRect);
+        event.region = invalidRect;
 
         switch (GetLayerManager(nsnull)->GetBackendType()) {
             case LayerManager::LAYERS_BASIC: {
 
                 nsRefPtr<gfxContext> ctx = new gfxContext(targetSurface);
 
                 {
                     mozilla::layers::RenderTraceScope trace2("Basic DrawTo", "727272");
@@ -1121,21 +1119,20 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
     layers::renderTraceEventStart("Get surface", "424545");
     static unsigned char bits2[32 * 32 * 2];
     nsRefPtr<gfxImageSurface> targetSurface =
         new gfxImageSurface(bits2, gfxIntSize(32, 32), 32 * 2,
                             gfxASurface::ImageFormatRGB16_565);
     layers::renderTraceEventEnd("Get surface", "424545");
 
     layers::renderTraceEventStart("Widget draw to", "434646");
-    nsIntRect dirtyRect = ae->Rect().Intersect(nsIntRect(0, 0, gAndroidBounds.width, gAndroidBounds.height));
     if (targetSurface->CairoStatus()) {
         ALOG("### Failed to create a valid surface from the bitmap");
     } else {
-        DrawTo(targetSurface, dirtyRect);
+        DrawTo(targetSurface, ae->Rect());
     }
     layers::renderTraceEventEnd("Widget draw to", "434646");
     return;
 #endif
 
     if (!sSurfaceExists) {
         return;
     }