Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1223)

Unified Diff: gm/pictureshader.cpp

Issue 953383002: fuzzer fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix up width and height in initializer Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/picture.cpp ('k') | gm/shadows.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « gm/picture.cpp ('k') | gm/shadows.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698