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

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

Issue 551853002: Turn on the save-layer optimization. (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 | src/core/SkRecordOpts.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 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 static SkRecord* optimized(SkRecord* r) {
643 SkRecordOptimize(r);
644 return r;
645 }
646
642 // fRecord OK 647 // fRecord OK
643 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh) 648 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh)
644 : fCullWidth(width) 649 : fCullWidth(width)
645 , fCullHeight(height) 650 , fCullHeight(height)
646 , fRecord(record) 651 , fRecord(optimized(record))
647 , fBBH(SkSafeRef(bbh)) 652 , fBBH(SkSafeRef(bbh))
648 , fAnalysis(*record) { 653 , fAnalysis(*fRecord) {
649 // TODO: move optimization before we construct fAnalysis?
650 SkRecordOptimize(record);
651 // TODO: delay as much of this work until just before first playback? 654 // TODO: delay as much of this work until just before first playback?
652 if (fBBH.get()) { 655 if (fBBH.get()) {
653 SkRecordFillBounds(*record, fBBH.get()); 656 SkRecordFillBounds(*fRecord, fBBH.get());
654 } 657 }
655 this->needsNewGenID(); 658 this->needsNewGenID();
656 } 659 }
657 660
658 // Note that we are assuming that this entry point will only be called from 661 // Note that we are assuming that this entry point will only be called from
659 // one thread. Currently the only client of this method is 662 // one thread. Currently the only client of this method is
660 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single 663 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single
661 // thread. 664 // thread.
662 void SkPicture::addDeletionListener(DeletionListener* listener) const { 665 void SkPicture::addDeletionListener(DeletionListener* listener) const {
663 SkASSERT(listener); 666 SkASSERT(listener);
(...skipping 13 matching lines...) Expand all
677 int SkPicture::approximateOpCount() const { 680 int SkPicture::approximateOpCount() const {
678 SkASSERT(fRecord.get() || fData.get()); 681 SkASSERT(fRecord.get() || fData.get());
679 if (fRecord.get()) { 682 if (fRecord.get()) {
680 return fRecord->count(); 683 return fRecord->count();
681 } 684 }
682 if (fData.get()) { 685 if (fData.get()) {
683 return fData->opCount(); 686 return fData->opCount();
684 } 687 }
685 return 0; 688 return 0;
686 } 689 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkRecordOpts.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698