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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const Context& ctx, | 120 const Context& ctx, |
121 SkBitmap* result, | 121 SkBitmap* result, |
122 SkIPoint* offset) const { | 122 SkIPoint* offset) const { |
123 SkBitmap background = src; | 123 SkBitmap background = src; |
124 SkIPoint backgroundOffset = SkIPoint::Make(0, 0); | 124 SkIPoint backgroundOffset = SkIPoint::Make(0, 0); |
125 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &backgro
und, | 125 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &backgro
und, |
126 &backgroundOffset)) { | 126 &backgroundOffset)) { |
127 return onFilterImage(proxy, src, ctx, result, offset); | 127 return onFilterImage(proxy, src, ctx, result, offset); |
128 } | 128 } |
129 GrTexture* backgroundTex = background.getTexture(); | 129 GrTexture* backgroundTex = background.getTexture(); |
| 130 |
| 131 if (NULL == backgroundTex) { |
| 132 SkASSERT(false); |
| 133 return false; |
| 134 } |
| 135 |
130 SkBitmap foreground = src; | 136 SkBitmap foreground = src; |
131 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); | 137 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); |
132 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro
und, | 138 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro
und, |
133 &foregroundOffset)) { | 139 &foregroundOffset)) { |
134 return onFilterImage(proxy, src, ctx, result, offset); | 140 return onFilterImage(proxy, src, ctx, result, offset); |
135 } | 141 } |
136 GrTexture* foregroundTex = foreground.getTexture(); | 142 GrTexture* foregroundTex = foreground.getTexture(); |
137 GrContext* context = foregroundTex->getContext(); | 143 GrContext* context = foregroundTex->getContext(); |
138 | 144 |
139 GrFragmentProcessor* xferProcessor = NULL; | 145 GrFragmentProcessor* xferProcessor = NULL; |
(...skipping 30 matching lines...) Expand all Loading... |
170 context->drawRect(paint, SkMatrix::I(), srcRect); | 176 context->drawRect(paint, SkMatrix::I(), srcRect); |
171 | 177 |
172 offset->fX = backgroundOffset.fX; | 178 offset->fX = backgroundOffset.fX; |
173 offset->fY = backgroundOffset.fY; | 179 offset->fY = backgroundOffset.fY; |
174 WrapTexture(dst, src.width(), src.height(), result); | 180 WrapTexture(dst, src.width(), src.height(), result); |
175 return true; | 181 return true; |
176 } | 182 } |
177 | 183 |
178 #endif | 184 #endif |
179 | 185 |
OLD | NEW |