diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-18 15:07:20 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-18 15:07:20 +0000 |
commit | b36334d46a488c2d4104a2cabf406cac0585f27e (patch) | |
tree | 0884e4b5f94148abc593c362edc5d7c50f58e780 /samplecode | |
parent | 79b3b7e916d874f78208d33b00a554270c19b72a (diff) |
lockPixels before looking at them in Zoomer
git-svn-id: http://skia.googlecode.com/svn/trunk@1363 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleApp.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index e6c5108308..7241185247 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -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; |