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