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

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

Issue 616033002: Clean up SK_PICTURE_USE_SK_RECORD and SK_PICTURE_OPTIMIZE_SK_RECORD. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // fRecord OK 631 // fRecord OK
632 uint32_t SkPicture::uniqueID() const { 632 uint32_t SkPicture::uniqueID() const {
633 if (SK_InvalidGenID == fUniqueID) { 633 if (SK_InvalidGenID == fUniqueID) {
634 fUniqueID = next_picture_generation_id(); 634 fUniqueID = next_picture_generation_id();
635 } 635 }
636 return fUniqueID; 636 return fUniqueID;
637 } 637 }
638 638
639 639
640 static SkRecord* optimized(SkRecord* r) { 640 static SkRecord* optimized(SkRecord* r) {
641 #ifdef SK_PICTURE_OPTIMIZE_SK_RECORD
642 SkRecordOptimize(r); 641 SkRecordOptimize(r);
643 #endif
644 return r; 642 return r;
645 } 643 }
646 644
647 // fRecord OK 645 // fRecord OK
648 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh) 646 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh)
649 : fCullWidth(width) 647 : fCullWidth(width)
650 , fCullHeight(height) 648 , fCullHeight(height)
651 , fRecord(optimized(record)) 649 , fRecord(optimized(record))
652 , fBBH(SkSafeRef(bbh)) 650 , fBBH(SkSafeRef(bbh))
653 , fAnalysis(*fRecord) { 651 , fAnalysis(*fRecord) {
(...skipping 26 matching lines...) Expand all
680 int SkPicture::approximateOpCount() const { 678 int SkPicture::approximateOpCount() const {
681 SkASSERT(fRecord.get() || fData.get()); 679 SkASSERT(fRecord.get() || fData.get());
682 if (fRecord.get()) { 680 if (fRecord.get()) {
683 return fRecord->count(); 681 return fRecord->count();
684 } 682 }
685 if (fData.get()) { 683 if (fData.get()) {
686 return fData->opCount(); 684 return fData->opCount();
687 } 685 }
688 return 0; 686 return 0;
689 } 687 }
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