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 "SkMergeImageFilter.h" | 8 #include "SkMergeImageFilter.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 canvas->clear(0x0); | 124 canvas->clear(0x0); |
125 | 125 |
126 // Composite all of the filter inputs. | 126 // Composite all of the filter inputs. |
127 for (int i = 0; i < inputCount; ++i) { | 127 for (int i = 0; i < inputCount; ++i) { |
128 if (!inputs[i]) { | 128 if (!inputs[i]) { |
129 continue; | 129 continue; |
130 } | 130 } |
131 | 131 |
132 SkPaint paint; | 132 SkPaint paint; |
133 if (fModes) { | 133 if (fModes) { |
134 paint.setXfermodeMode((SkXfermode::Mode)fModes[i]); | 134 paint.setBlendMode((SkBlendMode)fModes[i]); |
135 } | 135 } |
136 | 136 |
137 inputs[i]->draw(canvas, | 137 inputs[i]->draw(canvas, |
138 SkIntToScalar(offsets[i].x() - x0), SkIntToScalar(offset
s[i].y() - y0), | 138 SkIntToScalar(offsets[i].x() - x0), SkIntToScalar(offset
s[i].y() - y0), |
139 &paint); | 139 &paint); |
140 } | 140 } |
141 | 141 |
142 offset->fX = bounds.left(); | 142 offset->fX = bounds.left(); |
143 offset->fY = bounds.top(); | 143 offset->fY = bounds.top(); |
144 return surf->makeImageSnapshot(); | 144 return surf->makeImageSnapshot(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 for (int i = 0; i < this->countInputs(); ++i) { | 185 for (int i = 0; i < this->countInputs(); ++i) { |
186 SkImageFilter* filter = this->getInput(i); | 186 SkImageFilter* filter = this->getInput(i); |
187 str->appendf("%d: (", i); | 187 str->appendf("%d: (", i); |
188 filter->toString(str); | 188 filter->toString(str); |
189 str->appendf(")"); | 189 str->appendf(")"); |
190 } | 190 } |
191 | 191 |
192 str->append(")"); | 192 str->append(")"); |
193 } | 193 } |
194 #endif | 194 #endif |
OLD | NEW |