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

Unified Diff: samplecode/SampleTiling.cpp

Issue 239353006: Fix bug in SampleApp's Tiling View (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleTiling.cpp
===================================================================
--- samplecode/SampleTiling.cpp (revision 14210)
+++ samplecode/SampleTiling.cpp (working copy)
@@ -105,7 +105,7 @@
SkPictureRecorder recorder;
SkCanvas* textCanvas = NULL;
- if (fTextPicture->width() == 0) {
+ if (NULL == fTextPicture) {
textCanvas = recorder.beginRecording(1000, 1000);
}
@@ -146,7 +146,7 @@
x += r.width() * 4 / 3;
}
}
- if (textCanvas) {
+ if (NULL != textCanvas) {
SkPaint p;
SkString str;
p.setAntiAlias(true);
@@ -159,8 +159,12 @@
}
}
- fTextPicture.reset(recorder.endRecording());
+ if (NULL != textCanvas) {
+ SkASSERT(NULL == fTextPicture);
+ fTextPicture.reset(recorder.endRecording());
+ }
+ SkASSERT(NULL != fTextPicture);
canvas->drawPicture(*fTextPicture);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698