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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 SkBitmap input = src; | 84 SkBitmap input = src; |
85 SkIPoint pos = SkIPoint::Make(0, 0); | 85 SkIPoint pos = SkIPoint::Make(0, 0); |
86 if (!this->filterInput(i, proxy, src, ctx, &input, &pos)) { | 86 if (!this->filterInput(i, proxy, src, ctx, &input, &pos)) { |
87 continue; | 87 continue; |
88 } | 88 } |
89 if (fModes) { | 89 if (fModes) { |
90 paint.setXfermodeMode((SkXfermode::Mode)fModes[i]); | 90 paint.setXfermodeMode((SkXfermode::Mode)fModes[i]); |
91 } else { | 91 } else { |
92 paint.setXfermode(nullptr); | 92 paint.setXfermode(nullptr); |
93 } | 93 } |
94 canvas.drawSprite(input, pos.x() - x0, pos.y() - y0, &paint); | 94 canvas.drawBitmap(input, SkIntToScalar(pos.x() - x0), SkIntToScalar(pos.
y() - y0), &paint); |
95 didProduceResult = true; | 95 didProduceResult = true; |
96 } | 96 } |
97 | 97 |
98 if (!didProduceResult) | 98 if (!didProduceResult) |
99 return false; | 99 return false; |
100 | 100 |
101 offset->fX = bounds.left(); | 101 offset->fX = bounds.left(); |
102 offset->fY = bounds.top(); | 102 offset->fY = bounds.top(); |
103 *result = dst->accessBitmap(false); | 103 *result = dst->accessBitmap(false); |
104 return true; | 104 return true; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 for (int i = 0; i < this->countInputs(); ++i) { | 145 for (int i = 0; i < this->countInputs(); ++i) { |
146 SkImageFilter* filter = this->getInput(i); | 146 SkImageFilter* filter = this->getInput(i); |
147 str->appendf("%d: (", i); | 147 str->appendf("%d: (", i); |
148 filter->toString(str); | 148 filter->toString(str); |
149 str->appendf(")"); | 149 str->appendf(")"); |
150 } | 150 } |
151 | 151 |
152 str->append(")"); | 152 str->append(")"); |
153 } | 153 } |
154 #endif | 154 #endif |
OLD | NEW |