| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |