Index: samplecode/SampleApp.cpp |
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp |
index 15e56a3bb6eec63518cfaae08fe001585627bd78..53e15a5fdfd2ce40518767185fba9b00e13ce05d 100644 |
--- a/samplecode/SampleApp.cpp |
+++ b/samplecode/SampleApp.cpp |
@@ -1128,9 +1128,8 @@ |
static SkBitmap capture_bitmap(SkCanvas* canvas) { |
SkBitmap bm; |
- if (bm.allocPixels(canvas->imageInfo())) { |
- canvas->readPixels(&bm, 0, 0); |
- } |
+ const SkBitmap& src = canvas->getDevice()->accessBitmap(false); |
+ src.copyTo(&bm, src.config()); |
return bm; |
} |