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

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

Issue 348903004: Re-land "Fix external SkImageFilter caching with clips." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 cache->set(this, *result, *offset); 115 cache->set(this, *result, *offset);
116 return true; 116 return true;
117 } 117 }
118 return false; 118 return false;
119 } 119 }
120 120
121 bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm, 121 bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm,
122 SkIRect* dst) const { 122 SkIRect* dst) const {
123 SkASSERT(&src); 123 SkASSERT(&src);
124 SkASSERT(dst); 124 SkASSERT(dst);
125 if (SkImageFilter::GetExternalCache()) {
126 /*
127 * When the external cache is active, do not intersect the saveLayer
128 * bounds with the clip bounds. This is so that the cached result
129 * is always the full size of the primitive's bounds,
130 * regardless of the clip active on first draw.
131 */
132 *dst = SkIRect::MakeLargest();
133 return true;
134 }
125 return this->onFilterBounds(src, ctm, dst); 135 return this->onFilterBounds(src, ctm, dst);
126 } 136 }
127 137
128 void SkImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const { 138 void SkImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const {
129 if (0 == fInputCount) { 139 if (0 == fInputCount) {
130 *dst = src; 140 *dst = src;
131 return; 141 return;
132 } 142 }
133 if (this->getInput(0)) { 143 if (this->getInput(0)) {
134 this->getInput(0)->computeFastBounds(src, dst); 144 this->getInput(0)->computeFastBounds(src, dst);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 433
424 CacheImpl::~CacheImpl() { 434 CacheImpl::~CacheImpl() {
425 SkTDynamicHash<Value, Key>::Iter iter(&fData); 435 SkTDynamicHash<Value, Key>::Iter iter(&fData);
426 436
427 while (!iter.done()) { 437 while (!iter.done()) {
428 Value* v = &*iter; 438 Value* v = &*iter;
429 ++iter; 439 ++iter;
430 delete v; 440 delete v;
431 } 441 }
432 } 442 }
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