Move the beginTransaction from beginDrawing to endDrawing since we don't need to hold the lock during paint
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 Feb 2012 15:26:20 -0500
changeset 89236 60fdcec15ed3b4fb920ba2bdcbeff83b34aa8d03
parent 89235 61386b8c2272c57d899b12d59aa5ad7e56b157ef
child 89237 b6c7d207231f86948bd4fe8fa7cf080989d55eb6
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone13.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
Move the beginTransaction from beginDrawing to endDrawing since we don't need to hold the lock during paint
mobile/android/base/gfx/GeckoLayerClient.java
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -197,31 +197,30 @@ public class GeckoLayerClient implements
             }
 
             int wasted = area - (bufferRect.width() * bufferRect.height());
             Log.w(LOGTAG, "Prediction would avoid useless paint of " + wasted + " pixels (" + ((float)wasted * 100.0f / area) + "%)");
 
             bufferRect.offset(Math.round(-currentOrigin.x), Math.round(-currentOrigin.y));
         }
 
-        mTileLayer.beginTransaction();  // Called on gecko thread
-
         if (mBufferSize.width != width || mBufferSize.height != height) {
             mBufferSize = new IntSize(width, height);
         }
 
         return bufferRect;
     }
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature.
      *
      * TODO: Would be cleaner if this took an android.graphics.Rect instead, but that would require
      * a little more JNI magic.
      */
     public void endDrawing(int x, int y, int width, int height) {
+        mTileLayer.beginTransaction();  // Called on gecko thread
         synchronized (mLayerController) {
             try {
                 updateViewport(!mUpdateViewportOnEndDraw);
                 mUpdateViewportOnEndDraw = false;
             } finally {
                 mTileLayer.endTransaction();
             }
         }