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

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

Issue 561993002: Delay any SkRecordOptimize until after SkRecord has stuck. (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 | « no previous file | 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 static SkRecord* optimized(SkRecord* r) { 642 static SkRecord* optimized(SkRecord* r) {
643 SkRecordOptimize(r); 643 // TODO(mtklein): try this after SkRecord has stuck
644 //SkRecordOptimize(r);
644 return r; 645 return r;
645 } 646 }
646 647
647 // fRecord OK 648 // fRecord OK
648 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh) 649 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh)
649 : fCullWidth(width) 650 : fCullWidth(width)
650 , fCullHeight(height) 651 , fCullHeight(height)
651 , fRecord(optimized(record)) 652 , fRecord(optimized(record))
652 , fBBH(SkSafeRef(bbh)) 653 , fBBH(SkSafeRef(bbh))
653 , fAnalysis(*fRecord) { 654 , fAnalysis(*fRecord) {
(...skipping 26 matching lines...) Expand all
680 int SkPicture::approximateOpCount() const { 681 int SkPicture::approximateOpCount() const {
681 SkASSERT(fRecord.get() || fData.get()); 682 SkASSERT(fRecord.get() || fData.get());
682 if (fRecord.get()) { 683 if (fRecord.get()) {
683 return fRecord->count(); 684 return fRecord->count();
684 } 685 }
685 if (fData.get()) { 686 if (fData.get()) {
686 return fData->opCount(); 687 return fData->opCount();
687 } 688 }
688 return 0; 689 return 0;
689 } 690 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698