Index: gm/pictureshader.cpp |
diff --git a/gm/pictureshader.cpp b/gm/pictureshader.cpp |
index 630ecd8f0c60d7f456fc2e55f24b9240a705163d..3f184ec2d6418a10de8bd182a04d8e7d139dbb34 100644 |
--- a/gm/pictureshader.cpp |
+++ b/gm/pictureshader.cpp |
@@ -27,21 +27,23 @@ public: |
PictureShaderGM(SkScalar tileSize, SkScalar sceneSize) |
: fTileSize(tileSize) |
, fSceneSize(sceneSize) { |
+ } |
- // Build the picture. |
+ protected: |
+ void onOnceBeforeDraw() SK_OVERRIDE { |
+ // Build the picture. |
SkPictureRecorder recorder; |
- SkCanvas* pictureCanvas = recorder.beginRecording(tileSize, tileSize, NULL, 0); |
+ SkCanvas* pictureCanvas = recorder.beginRecording(fTileSize, fTileSize, NULL, 0); |
this->drawTile(pictureCanvas); |
fPicture.reset(recorder.endRecording()); |
// Build a reference bitmap. |
- fBitmap.allocN32Pixels(SkScalarCeilToInt(tileSize), SkScalarCeilToInt(tileSize)); |
+ fBitmap.allocN32Pixels(SkScalarCeilToInt(fTileSize), SkScalarCeilToInt(fTileSize)); |
fBitmap.eraseColor(SK_ColorTRANSPARENT); |
SkCanvas bitmapCanvas(fBitmap); |
this->drawTile(&bitmapCanvas); |
} |
-protected: |
SkString onShortName() SK_OVERRIDE { |
return SkString("pictureshader"); |