Clean up nsWindow::Draw() a bit
authorPatrick Walton <pwalton@mozilla.com>
Thu, 02 Feb 2012 20:24:49 -0800
changeset 90875 6a17b93d69336766e3407e720a2367611cd7027d
parent 90874 78631ebfbd86baf31a2501c4e042eb1fbd46a1c1
child 90876 5e47633414952424bf3fe0eeac621bea5ff587ce
push idunknown
push userunknown
push dateunknown
milestone12.0a1
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();
     }