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

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

Issue 573773002: Add flag to call SkRecordOptimize on new pictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | « gyp/common_conditions.gypi ('k') | no next file » | 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 632 }
633 633
634 // fRecord OK 634 // fRecord OK
635 uint32_t SkPicture::uniqueID() const { 635 uint32_t SkPicture::uniqueID() const {
636 if (SK_InvalidGenID == fUniqueID) { 636 if (SK_InvalidGenID == fUniqueID) {
637 fUniqueID = next_picture_generation_id(); 637 fUniqueID = next_picture_generation_id();
638 } 638 }
639 return fUniqueID; 639 return fUniqueID;
640 } 640 }
641 641
642
642 static SkRecord* optimized(SkRecord* r) { 643 static SkRecord* optimized(SkRecord* r) {
643 // TODO(mtklein): try this after SkRecord has stuck 644 #ifdef SK_PICTURE_OPTIMIZE_SK_RECORD
644 //SkRecordOptimize(r); 645 SkRecordOptimize(r);
646 #endif
645 return r; 647 return r;
646 } 648 }
647 649
648 // fRecord OK 650 // fRecord OK
649 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh) 651 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh)
650 : fCullWidth(width) 652 : fCullWidth(width)
651 , fCullHeight(height) 653 , fCullHeight(height)
652 , fRecord(optimized(record)) 654 , fRecord(optimized(record))
653 , fBBH(SkSafeRef(bbh)) 655 , fBBH(SkSafeRef(bbh))
654 , fAnalysis(*fRecord) { 656 , fAnalysis(*fRecord) {
(...skipping 26 matching lines...) Expand all
681 int SkPicture::approximateOpCount() const { 683 int SkPicture::approximateOpCount() const {
682 SkASSERT(fRecord.get() || fData.get()); 684 SkASSERT(fRecord.get() || fData.get());
683 if (fRecord.get()) { 685 if (fRecord.get()) {
684 return fRecord->count(); 686 return fRecord->count();
685 } 687 }
686 if (fData.get()) { 688 if (fData.get()) {
687 return fData->opCount(); 689 return fData->opCount();
688 } 690 }
689 return 0; 691 return 0;
690 } 692 }
OLDNEW
« no previous file with comments | « gyp/common_conditions.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698