OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 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 "SkXfermodeImageFilter.h" | 8 #include "SkXfermodeImageFilter.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 #ifndef SK_IGNORE_TO_STRING | 101 #ifndef SK_IGNORE_TO_STRING |
102 void SkXfermodeImageFilter::toString(SkString* str) const { | 102 void SkXfermodeImageFilter::toString(SkString* str) const { |
103 str->appendf("SkXfermodeImageFilter: ("); | 103 str->appendf("SkXfermodeImageFilter: ("); |
104 str->appendf("xfermode: ("); | 104 str->appendf("xfermode: ("); |
105 if (fMode) { | 105 if (fMode) { |
106 fMode->toString(str); | 106 fMode->toString(str); |
107 } | 107 } |
108 str->append("))"); | 108 str->append(")"); |
| 109 if (this->getInput(0)) { |
| 110 str->appendf("foreground: ("); |
| 111 this->getInput(0)->toString(str); |
| 112 str->appendf(")"); |
| 113 } |
| 114 if (this->getInput(1)) { |
| 115 str->appendf("background: ("); |
| 116 this->getInput(1)->toString(str); |
| 117 str->appendf(")"); |
| 118 } |
| 119 str->append(")"); |
109 } | 120 } |
110 #endif | 121 #endif |
111 | 122 |
112 #if SK_SUPPORT_GPU | 123 #if SK_SUPPORT_GPU |
113 | 124 |
114 bool SkXfermodeImageFilter::canFilterImageGPU() const { | 125 bool SkXfermodeImageFilter::canFilterImageGPU() const { |
115 return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet(); | 126 return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet(); |
116 } | 127 } |
117 | 128 |
118 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, | 129 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 SkMatrix::I(), srcRect); | 200 SkMatrix::I(), srcRect); |
190 | 201 |
191 offset->fX = backgroundOffset.fX; | 202 offset->fX = backgroundOffset.fX; |
192 offset->fY = backgroundOffset.fY; | 203 offset->fY = backgroundOffset.fY; |
193 WrapTexture(dst, src.width(), src.height(), result); | 204 WrapTexture(dst, src.width(), src.height(), result); |
194 return true; | 205 return true; |
195 } | 206 } |
196 | 207 |
197 #endif | 208 #endif |
198 | 209 |
OLD | NEW |