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 | |
135 bool SkColorFilterImageFilter::affectsTransparentBlack() const { | 129 bool SkColorFilterImageFilter::affectsTransparentBlack() const { |
136 return fColorFilter->affectsTransparentBlack(); | 130 return fColorFilter->affectsTransparentBlack(); |
137 } | 131 } |
138 | 132 |
139 #ifndef SK_IGNORE_TO_STRING | 133 #ifndef SK_IGNORE_TO_STRING |
140 void SkColorFilterImageFilter::toString(SkString* str) const { | 134 void SkColorFilterImageFilter::toString(SkString* str) const { |
141 str->appendf("SkColorFilterImageFilter: ("); | 135 str->appendf("SkColorFilterImageFilter: ("); |
142 | 136 |
143 str->appendf("input: ("); | 137 str->appendf("input: ("); |
144 | 138 |
145 if (this->getInput(0)) { | 139 if (this->getInput(0)) { |
146 this->getInput(0)->toString(str); | 140 this->getInput(0)->toString(str); |
147 } | 141 } |
148 | 142 |
149 str->appendf(") color filter: "); | 143 str->appendf(") color filter: "); |
150 fColorFilter->toString(str); | 144 fColorFilter->toString(str); |
151 | 145 |
152 str->append(")"); | 146 str->append(")"); |
153 } | 147 } |
154 #endif | 148 #endif |
OLD | NEW |