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

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

Issue 492023002: Install a hook to swap between SkPicture backends with a single define. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 6 years, 4 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
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | src/core/SkPictureRecorder.cpp » ('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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 SkPictInfo info; 273 SkPictInfo info;
274 this->createHeader(&info); 274 this->createHeader(&info);
275 fData.reset(SkNEW_ARGS(SkPictureData, (record, info, deepCopyOps))); 275 fData.reset(SkNEW_ARGS(SkPictureData, (record, info, deepCopyOps)));
276 } 276 }
277 277
278 // Create an SkPictureData-backed SkPicture from an SkRecord. 278 // Create an SkPictureData-backed SkPicture from an SkRecord.
279 // This for compatibility with serialization code only. This is not cheap. 279 // This for compatibility with serialization code only. This is not cheap.
280 static SkPicture* backport(const SkRecord& src, int width, int height) { 280 static SkPicture* backport(const SkRecord& src, int width, int height) {
281 SkPictureRecorder recorder; 281 SkPictureRecorder recorder;
282 SkRecordDraw(src, recorder.beginRecording(width, height), NULL/*bbh*/, NULL/ *callback*/); 282 SkRecordDraw(src,
283 recorder.DEPRECATED_beginRecording(width, height), NULL/*bbh*/, NULL/*callback*/);
283 return recorder.endRecording(); 284 return recorder.endRecording();
284 } 285 }
285 286
286 // fRecord OK 287 // fRecord OK
287 SkPicture::~SkPicture() { 288 SkPicture::~SkPicture() {
288 this->callDeletionListeners(); 289 this->callDeletionListeners();
289 } 290 }
290 291
291 // fRecord OK 292 // fRecord OK
292 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE 293 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 int SkPicture::approximateOpCount() const { 648 int SkPicture::approximateOpCount() const {
648 SkASSERT(fRecord.get() || fData.get()); 649 SkASSERT(fRecord.get() || fData.get());
649 if (fRecord.get()) { 650 if (fRecord.get()) {
650 return fRecord->count(); 651 return fRecord->count();
651 } 652 }
652 if (fData.get()) { 653 if (fData.get()) {
653 return fData->opCount(); 654 return fData->opCount();
654 } 655 }
655 return 0; 656 return 0;
656 } 657 }
OLDNEW
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698