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

Side by Side Diff: src/core/SkPicture.cpp

Issue 14598023: add SkDrawPictureCallback optional parameter to drawPicture(), which can abort the picture drawing. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (NULL != fRecord) { 246 if (NULL != fRecord) {
247 fRecord->endRecording(); 247 fRecord->endRecording();
248 fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord)); 248 fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord));
249 fRecord->unref(); 249 fRecord->unref();
250 fRecord = NULL; 250 fRecord = NULL;
251 } 251 }
252 } 252 }
253 SkASSERT(NULL == fRecord); 253 SkASSERT(NULL == fRecord);
254 } 254 }
255 255
256 void SkPicture::draw(SkCanvas* surface) { 256 void SkPicture::draw(SkCanvas* surface, SkDrawPictureCallback* callback) {
257 this->endRecording(); 257 this->endRecording();
258 if (fPlayback) { 258 if (fPlayback) {
259 fPlayback->draw(*surface); 259 fPlayback->draw(*surface, callback);
260 } 260 }
261 } 261 }
262 262
263 /////////////////////////////////////////////////////////////////////////////// 263 ///////////////////////////////////////////////////////////////////////////////
264 264
265 #include "SkStream.h" 265 #include "SkStream.h"
266 266
267 SkPicture::SkPicture(SkStream* stream) { 267 SkPicture::SkPicture(SkStream* stream) {
268 this->initFromStream(stream, NULL, NULL); 268 this->initFromStream(stream, NULL, NULL);
269 } 269 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 336
337 #ifdef SK_BUILD_FOR_ANDROID 337 #ifdef SK_BUILD_FOR_ANDROID
338 void SkPicture::abortPlayback() { 338 void SkPicture::abortPlayback() {
339 if (NULL == fPlayback) { 339 if (NULL == fPlayback) {
340 return; 340 return;
341 } 341 }
342 fPlayback->abort(); 342 fPlayback->abort();
343 } 343 }
344 #endif 344 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698