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

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

Issue 696763002: Shrink saveLayer device bounds when it supplies an explicit bounds and has a complex paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 6 years, 1 month 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/SkRecordDraw.h » ('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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 // fRecord OK 625 // fRecord OK
626 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh) 626 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi erarchy* bbh)
627 : fCullWidth(width) 627 : fCullWidth(width)
628 , fCullHeight(height) 628 , fCullHeight(height)
629 , fRecord(optimized(record)) 629 , fRecord(optimized(record))
630 , fBBH(SkSafeRef(bbh)) 630 , fBBH(SkSafeRef(bbh))
631 , fAnalysis(*fRecord) { 631 , fAnalysis(*fRecord) {
632 // TODO: delay as much of this work until just before first playback? 632 // TODO: delay as much of this work until just before first playback?
633 if (fBBH.get()) { 633 if (fBBH.get()) {
634 SkRecordFillBounds(*fRecord, fBBH.get()); 634 SkRecordFillBounds(this->cullRect(), *fRecord, fBBH.get());
635 } 635 }
636 this->needsNewGenID(); 636 this->needsNewGenID();
637 } 637 }
638 638
639 // Note that we are assuming that this entry point will only be called from 639 // Note that we are assuming that this entry point will only be called from
640 // one thread. Currently the only client of this method is 640 // one thread. Currently the only client of this method is
641 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single 641 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single
642 // thread. 642 // thread.
643 void SkPicture::addDeletionListener(DeletionListener* listener) const { 643 void SkPicture::addDeletionListener(DeletionListener* listener) const {
644 SkASSERT(listener); 644 SkASSERT(listener);
(...skipping 13 matching lines...) Expand all
658 int SkPicture::approximateOpCount() const { 658 int SkPicture::approximateOpCount() const {
659 SkASSERT(fRecord.get() || fData.get()); 659 SkASSERT(fRecord.get() || fData.get());
660 if (fRecord.get()) { 660 if (fRecord.get()) {
661 return fRecord->count(); 661 return fRecord->count();
662 } 662 }
663 if (fData.get()) { 663 if (fData.get()) {
664 return fData->opCount(); 664 return fData->opCount();
665 } 665 }
666 return 0; 666 return 0;
667 } 667 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkRecordDraw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698