aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleTiling.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-15 23:00:57 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-15 23:00:57 +0000
commit0dd01ee5b5abc06935dced8430d5290c6ac3f958 (patch)
tree342b5c5ec7af4edcb85f41e28fa88998fb54c0dd /samplecode/SampleTiling.cpp
parent7dd79b77113d00e7ff517a4485034a9005f501ba (diff)
Fix bug in SampleApp's Tiling View
SampleApp was crashing when invoked as "SampleApp --slide Tiling" due to r14171 (split SkPictureRecorder out of SkPicture - https://codereview.chromium.org/214953003/) R=bungeman@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/239353006 git-svn-id: http://skia.googlecode.com/svn/trunk@14214 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleTiling.cpp')
-rw-r--r--samplecode/SampleTiling.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index 7d109fd50f..d26701273e 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -105,7 +105,7 @@ protected:
SkPictureRecorder recorder;
SkCanvas* textCanvas = NULL;
- if (fTextPicture->width() == 0) {
+ if (NULL == fTextPicture) {
textCanvas = recorder.beginRecording(1000, 1000);
}
@@ -146,7 +146,7 @@ protected:
x += r.width() * 4 / 3;
}
}
- if (textCanvas) {
+ if (NULL != textCanvas) {
SkPaint p;
SkString str;
p.setAntiAlias(true);
@@ -159,8 +159,12 @@ protected:
}
}
- fTextPicture.reset(recorder.endRecording());
+ if (NULL != textCanvas) {
+ SkASSERT(NULL == fTextPicture);
+ fTextPicture.reset(recorder.endRecording());
+ }
+ SkASSERT(NULL != fTextPicture);
canvas->drawPicture(*fTextPicture);
}