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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 SkASSERT(1 == this->countInputs()); | 119 SkASSERT(1 == this->countInputs()); |
120 if (!this->cropRectIsSet()) { | 120 if (!this->cropRectIsSet()) { |
121 if (filter) { | 121 if (filter) { |
122 *filter = SkRef(fColorFilter.get()); | 122 *filter = SkRef(fColorFilter.get()); |
123 } | 123 } |
124 return true; | 124 return true; |
125 } | 125 } |
126 return false; | 126 return false; |
127 } | 127 } |
128 | 128 |
| 129 bool SkColorFilterImageFilter::onCanHandleAffine() const { |
| 130 SkASSERT(1 == this->countInputs()); |
| 131 SkImageFilter* input = this->getInput(0); |
| 132 return !input || input->canHandleAffine(); |
| 133 } |
| 134 |
129 bool SkColorFilterImageFilter::affectsTransparentBlack() const { | 135 bool SkColorFilterImageFilter::affectsTransparentBlack() const { |
130 return fColorFilter->affectsTransparentBlack(); | 136 return fColorFilter->affectsTransparentBlack(); |
131 } | 137 } |
132 | 138 |
133 #ifndef SK_IGNORE_TO_STRING | 139 #ifndef SK_IGNORE_TO_STRING |
134 void SkColorFilterImageFilter::toString(SkString* str) const { | 140 void SkColorFilterImageFilter::toString(SkString* str) const { |
135 str->appendf("SkColorFilterImageFilter: ("); | 141 str->appendf("SkColorFilterImageFilter: ("); |
136 | 142 |
137 str->appendf("input: ("); | 143 str->appendf("input: ("); |
138 | 144 |
139 if (this->getInput(0)) { | 145 if (this->getInput(0)) { |
140 this->getInput(0)->toString(str); | 146 this->getInput(0)->toString(str); |
141 } | 147 } |
142 | 148 |
143 str->appendf(") color filter: "); | 149 str->appendf(") color filter: "); |
144 fColorFilter->toString(str); | 150 fColorFilter->toString(str); |
145 | 151 |
146 str->append(")"); | 152 str->append(")"); |
147 } | 153 } |
148 #endif | 154 #endif |
OLD | NEW |