OSDN Git Service

Update plugin's dirtyRect to match the dirtyRect returned when locking a surface.
authorDerek Sollenberger <djsollen@google.com>
Mon, 3 May 2010 19:26:15 +0000 (15:26 -0400)
committerDerek Sollenberger <djsollen@google.com>
Mon, 3 May 2010 19:26:15 +0000 (15:26 -0400)
Change-Id: I2c3e6daa10eb9eb651be52bf9387008f154b176d
http://b/2650954

WebKit/android/plugins/ANPSurfaceInterface.cpp

index cb32ed5..8830191 100644 (file)
@@ -118,6 +118,16 @@ static bool anp_lock(JNIEnv* env, jobject surfaceView, ANPBitmap* bitmap, ANPRec
         return false;
     }
 
+    // the surface may have expanded the dirty region so we must to pass that
+    // information back to the plugin.
+    if (dirtyRect) {
+        Rect dirtyBounds = dirtyRegion.getBounds();
+        dirtyRect->left = dirtyBounds.left;
+        dirtyRect->right = dirtyBounds.right;
+        dirtyRect->top = dirtyBounds.top;
+        dirtyRect->bottom = dirtyBounds.bottom;
+    }
+
     ssize_t bpr = info.s * bytesPerPixel(info.format);
 
     bitmap->format = convertPixelFormat(info.format);