Index: gm/bitmapcopy.cpp |
diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp |
index f210b4aa5e0870e2c55682924c5e93831797be95..928b4037c136000d0d9910102c37ad51c5a4a31d 100644 |
--- a/gm/bitmapcopy.cpp |
+++ b/gm/bitmapcopy.cpp |
@@ -62,14 +62,14 @@ |
virtual void onDraw(SkCanvas* canvas) { |
SkPaint paint; |
- SkScalar horizMargin = 10; |
- SkScalar vertMargin = 10; |
+ SkScalar horizMargin(SkIntToScalar(10)); |
+ SkScalar vertMargin(SkIntToScalar(10)); |
- SkBitmap src; |
- src.allocN32Pixels(40, 40); |
- SkCanvas canvasTmp(src); |
+ SkBitmapDevice devTmp(SkBitmap::kARGB_8888_Config, 40, 40, false); |
+ SkCanvas canvasTmp(&devTmp); |
draw_checks(&canvasTmp, 40, 40); |
+ SkBitmap src = canvasTmp.getTopDevice()->accessBitmap(false); |
for (unsigned i = 0; i < NUM_CONFIGS; ++i) { |
if (!src.deepCopyTo(&fDst[i], gConfigs[i])) { |