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

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

Issue 195793010: Add a means of extracting active operations from SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix bug & add unit test Created 6 years, 9 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
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (NULL == fPlayback) { 257 if (NULL == fPlayback) {
258 if (NULL != fRecord) { 258 if (NULL != fRecord) {
259 fRecord->endRecording(); 259 fRecord->endRecording();
260 fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord)); 260 fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord));
261 SkSafeSetNull(fRecord); 261 SkSafeSetNull(fRecord);
262 } 262 }
263 } 263 }
264 SkASSERT(NULL == fRecord); 264 SkASSERT(NULL == fRecord);
265 } 265 }
266 266
267 const SkPicture::OperationList& SkPicture::OperationList::InvalidList() {
268 static OperationList gInvalid;
269 return gInvalid;
270 }
271
272 const SkPicture::OperationList& SkPicture::EXPERIMENTAL_getActiveOps(const SkIRe ct& queryRect) {
273 this->endRecording();
274 if (NULL != fPlayback) {
275 return fPlayback->getActiveOps(queryRect);
276 }
277 return OperationList::InvalidList();
278 }
279
267 void SkPicture::draw(SkCanvas* surface, SkDrawPictureCallback* callback) { 280 void SkPicture::draw(SkCanvas* surface, SkDrawPictureCallback* callback) {
268 this->endRecording(); 281 this->endRecording();
269 if (NULL != fPlayback) { 282 if (NULL != fPlayback) {
270 fPlayback->draw(*surface, callback); 283 fPlayback->draw(*surface, callback);
271 } 284 }
272 } 285 }
273 286
274 /////////////////////////////////////////////////////////////////////////////// 287 ///////////////////////////////////////////////////////////////////////////////
275 288
276 #include "SkStream.h" 289 #include "SkStream.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } 455 }
443 456
444 #ifdef SK_BUILD_FOR_ANDROID 457 #ifdef SK_BUILD_FOR_ANDROID
445 void SkPicture::abortPlayback() { 458 void SkPicture::abortPlayback() {
446 if (NULL == fPlayback) { 459 if (NULL == fPlayback) {
447 return; 460 return;
448 } 461 }
449 fPlayback->abort(); 462 fPlayback->abort();
450 } 463 }
451 #endif 464 #endif
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698