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 "SkColorFilterImageFilter.h" | 8 #include "SkColorFilterImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 SkASSERT(1 == this->countInputs()); | 92 SkASSERT(1 == this->countInputs()); |
93 if (!this->cropRectIsSet()) { | 93 if (!this->cropRectIsSet()) { |
94 if (filter) { | 94 if (filter) { |
95 *filter = SkRef(fColorFilter); | 95 *filter = SkRef(fColorFilter); |
96 } | 96 } |
97 return true; | 97 return true; |
98 } | 98 } |
99 return false; | 99 return false; |
100 } | 100 } |
101 | 101 |
102 bool SkColorFilterImageFilter::canComputeFastBounds() const { | 102 bool SkColorFilterImageFilter::affectsTransparentBlack() const { |
103 if (fColorFilter->affectsTransparentBlack()) { | 103 return fColorFilter->affectsTransparentBlack(); |
104 return false; | |
105 } | |
106 return INHERITED::canComputeFastBounds(); | |
107 } | 104 } |
108 | 105 |
109 #ifndef SK_IGNORE_TO_STRING | 106 #ifndef SK_IGNORE_TO_STRING |
110 void SkColorFilterImageFilter::toString(SkString* str) const { | 107 void SkColorFilterImageFilter::toString(SkString* str) const { |
111 str->appendf("SkColorFilterImageFilter: ("); | 108 str->appendf("SkColorFilterImageFilter: ("); |
112 | 109 |
113 str->appendf("input: ("); | 110 str->appendf("input: ("); |
114 | 111 |
115 if (this->getInput(0)) { | 112 if (this->getInput(0)) { |
116 this->getInput(0)->toString(str); | 113 this->getInput(0)->toString(str); |
117 } | 114 } |
118 | 115 |
119 str->appendf(") color filter: "); | 116 str->appendf(") color filter: "); |
120 fColorFilter->toString(str); | 117 fColorFilter->toString(str); |
121 | 118 |
122 str->append(")"); | 119 str->append(")"); |
123 } | 120 } |
124 #endif | 121 #endif |
OLD | NEW |