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