lockPixels before looking at them in Zoomer
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 18 May 2011 15:07:20 +0000 (15:07 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 18 May 2011 15:07:20 +0000 (15:07 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@1363 2bbb7eff-a529-9590-31e7-b0007b416f81

samplecode/SampleApp.cpp

index e6c51083081356bf6081fb133b7b00487c879c67..7241185247f070900a51a2b50a4e012f87687008 100644 (file)
@@ -625,7 +625,10 @@ void SampleWindow::draw(SkCanvas* canvas) {
         else if (fMouseX < 0) fMouseX = 0;
         if (fMouseY >= height) fMouseY = height - 1;
         else if (fMouseY < 0) fMouseY = 0;
+
         SkBitmap bitmap = capture_bitmap(canvas);
+        bitmap.lockPixels();
+
         // Find the size of the zoomed in view, forced to be odd, so the examined pixel is in the middle.
         int zoomedWidth = (width >> 1) | 1;
         int zoomedHeight = (height >> 1) | 1;