Changes the SkCanvas::readPixels API. Allows caller to read into prealloced bitmap pixels. Changes how clipping to device bounds is handled.
Review URL: http://codereview.appspot.com/5307077/
git-svn-id: http://skia.googlecode.com/svn/trunk@2584 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 5269b34..f2ab703 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -251,7 +251,9 @@
// the device is as large as the current rendertarget, so we explicitly
// only readback the amount we expect (in size)
// overwrite our previous allocation
- gc.readPixels(SkIRect::MakeSize(size), bitmap);
+ bitmap->setConfig(SkBitmap::kARGB_8888_Config, size.fWidth,
+ size.fHeight);
+ gc.readPixels(bitmap, 0, 0);
}
return true;
}