Clean up nsWindow::Draw() a bit
authorPatrick Walton <pwalton@mozilla.com>
Thu, 02 Feb 2012 20:24:49 -0800
changeset 92376 6a17b93d69336766e3407e720a2367611cd7027d
parent 92375 78631ebfbd86baf31a2501c4e042eb1fbd46a1c1
child 92377 5e47633414952424bf3fe0eeac621bea5ff587ce
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.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
Clean up nsWindow::Draw() a bit
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1279,37 +1279,23 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
           sDirectTexture->Height() != gAndroidBounds.height) {
         sDirectTexture->Reallocate(gAndroidBounds.width, gAndroidBounds.height);
       }
 
       sDirectTexture->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, dirtyRect, &bits);
     } else {
       bits = client.LockBufferBits();
     }
+
     if (!bits) {
         ALOG("### Failed to lock buffer");
+    } else if (targetSurface->CairoStatus()) {
+        ALOG("### Failed to create a valid surface from the bitmap");
     } else {
-        // If tile size is 0,0, we assume we only have a single tile
-        int tileWidth = (gAndroidTileSize.width > 0) ? gAndroidTileSize.width : gAndroidBounds.width;
-        int tileHeight = (gAndroidTileSize.height > 0) ? gAndroidTileSize.height : gAndroidBounds.height;
-
-        int offset = 0;
-
-        // It is assumed that the buffer has been over-allocated so that not
-        // only is the tile-size constant, but that a render-offset of anything
-        // up to (but not including) the tile size could be accommodated.
-        int x = 0, y = 0;
-
-
-        if (targetSurface->CairoStatus()) {
-            ALOG("### Failed to create a valid surface from the bitmap");
-            //break;
-        } else {
-            DrawTo(targetSurface, dirtyRect);
-        }
+        DrawTo(targetSurface, dirtyRect);
     }
 
     if (HasDirectTexture()) {
         sDirectTexture->Unlock();
     } else {
         client.UnlockBuffer();
     }