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(")"); | |
120 } | 109 } |
121 #endif | 110 #endif |
122 | 111 |
123 #if SK_SUPPORT_GPU | 112 #if SK_SUPPORT_GPU |
124 | 113 |
125 bool SkXfermodeImageFilter::canFilterImageGPU() const { | 114 bool SkXfermodeImageFilter::canFilterImageGPU() const { |
126 return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet(); | 115 return fMode && fMode->asFragmentProcessor(NULL, NULL) && !cropRectIsSet(); |
127 } | 116 } |
128 | 117 |
129 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, | 118 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 SkMatrix::I(), srcRect); | 189 SkMatrix::I(), srcRect); |
201 | 190 |
202 offset->fX = backgroundOffset.fX; | 191 offset->fX = backgroundOffset.fX; |
203 offset->fY = backgroundOffset.fY; | 192 offset->fY = backgroundOffset.fY; |
204 WrapTexture(dst, src.width(), src.height(), result); | 193 WrapTexture(dst, src.width(), src.height(), result); |
205 return true; | 194 return true; |
206 } | 195 } |
207 | 196 |
208 #endif | 197 #endif |
209 | 198 |
OLD | NEW |