From 0dd01ee5b5abc06935dced8430d5290c6ac3f958 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Tue, 15 Apr 2014 23:00:57 +0000 Subject: 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 --- samplecode/SampleTiling.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'samplecode') 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); } -- cgit v1.2.3