| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro
und, | 138 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro
und, |
| 139 &foregroundOffset)) { | 139 &foregroundOffset)) { |
| 140 return onFilterImage(proxy, src, ctx, result, offset); | 140 return onFilterImage(proxy, src, ctx, result, offset); |
| 141 } | 141 } |
| 142 GrTexture* foregroundTex = foreground.getTexture(); | 142 GrTexture* foregroundTex = foreground.getTexture(); |
| 143 GrContext* context = foregroundTex->getContext(); | 143 GrContext* context = foregroundTex->getContext(); |
| 144 | 144 |
| 145 GrFragmentProcessor* xferProcessor = NULL; | 145 GrFragmentProcessor* xferProcessor = NULL; |
| 146 | 146 |
| 147 GrSurfaceDesc desc; | 147 GrSurfaceDesc desc; |
| 148 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; | 148 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 149 desc.fWidth = src.width(); | 149 desc.fWidth = src.width(); |
| 150 desc.fHeight = src.height(); | 150 desc.fHeight = src.height(); |
| 151 desc.fConfig = kSkia8888_GrPixelConfig; | 151 desc.fConfig = kSkia8888_GrPixelConfig; |
| 152 SkAutoTUnref<GrTexture> dst( | 152 SkAutoTUnref<GrTexture> dst( |
| 153 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); | 153 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); |
| 154 if (!dst) { | 154 if (!dst) { |
| 155 return false; | 155 return false; |
| 156 } | 156 } |
| 157 | 157 |
| 158 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) { | 158 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 175 context->drawRect(dst->asRenderTarget(), paint, SkMatrix::I(), srcRect); | 175 context->drawRect(dst->asRenderTarget(), paint, SkMatrix::I(), srcRect); |
| 176 | 176 |
| 177 offset->fX = backgroundOffset.fX; | 177 offset->fX = backgroundOffset.fX; |
| 178 offset->fY = backgroundOffset.fY; | 178 offset->fY = backgroundOffset.fY; |
| 179 WrapTexture(dst, src.width(), src.height(), result); | 179 WrapTexture(dst, src.width(), src.height(), result); |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| 183 #endif | 183 #endif |
| 184 | 184 |
| OLD | NEW |