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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 paint.getProcessorDataManager(), | 185 paint.getProcessorDataManager(), |
186 foregroundTex, foregroundMatrix, | 186 foregroundTex, foregroundMatrix, |
187 GrTextureDomain::MakeTexelDomain(foregroundTex, foreground.bounds()), | 187 GrTextureDomain::MakeTexelDomain(foregroundTex, foreground.bounds()), |
188 GrTextureDomain::kDecal_Mode, | 188 GrTextureDomain::kDecal_Mode, |
189 GrTextureParams::kNone_FilterMode) | 189 GrTextureParams::kNone_FilterMode) |
190 ); | 190 ); |
191 | 191 |
192 paint.addColorFragmentProcessor(foregroundDomain.get()); | 192 paint.addColorFragmentProcessor(foregroundDomain.get()); |
193 paint.addColorFragmentProcessor(xferProcessor)->unref(); | 193 paint.addColorFragmentProcessor(xferProcessor)->unref(); |
194 | 194 |
195 GrDrawContext* drawContext = context->drawContext(); | 195 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); |
196 if (!drawContext) { | 196 if (!drawContext) { |
197 return false; | 197 return false; |
198 } | 198 } |
199 | 199 |
200 drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, | 200 drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, |
201 SkMatrix::I(), srcRect); | 201 SkMatrix::I(), srcRect); |
202 | 202 |
203 offset->fX = backgroundOffset.fX; | 203 offset->fX = backgroundOffset.fX; |
204 offset->fY = backgroundOffset.fY; | 204 offset->fY = backgroundOffset.fY; |
205 WrapTexture(dst, src.width(), src.height(), result); | 205 WrapTexture(dst, src.width(), src.height(), result); |
206 return true; | 206 return true; |
207 } | 207 } |
208 | 208 |
209 #endif | 209 #endif |
210 | 210 |
OLD | NEW |