| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 GrTexture* foregroundTex = foreground.getTexture(); | 141 GrTexture* foregroundTex = foreground.getTexture(); |
| 142 GrContext* context = foregroundTex->getContext(); | 142 GrContext* context = foregroundTex->getContext(); |
| 143 | 143 |
| 144 GrFragmentProcessor* xferProcessor = NULL; | 144 GrFragmentProcessor* xferProcessor = NULL; |
| 145 | 145 |
| 146 GrSurfaceDesc desc; | 146 GrSurfaceDesc desc; |
| 147 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 147 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 148 desc.fWidth = src.width(); | 148 desc.fWidth = src.width(); |
| 149 desc.fHeight = src.height(); | 149 desc.fHeight = src.height(); |
| 150 desc.fConfig = kSkia8888_GrPixelConfig; | 150 desc.fConfig = kSkia8888_GrPixelConfig; |
| 151 SkAutoTUnref<GrTexture> dst( | 151 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture( |
| 152 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); | 152 desc, GrTextureProvider::kApprox_ScratchTexMatch)); |
| 153 if (!dst) { | 153 if (!dst) { |
| 154 return false; | 154 return false; |
| 155 } | 155 } |
| 156 | 156 |
| 157 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) { | 157 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) { |
| 158 // canFilterImageGPU() should've taken care of this | 158 // canFilterImageGPU() should've taken care of this |
| 159 SkASSERT(false); | 159 SkASSERT(false); |
| 160 return false; | 160 return false; |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 181 context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix
::I(), srcRect); | 181 context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix
::I(), srcRect); |
| 182 | 182 |
| 183 offset->fX = backgroundOffset.fX; | 183 offset->fX = backgroundOffset.fX; |
| 184 offset->fY = backgroundOffset.fY; | 184 offset->fY = backgroundOffset.fY; |
| 185 WrapTexture(dst, src.width(), src.height(), result); | 185 WrapTexture(dst, src.width(), src.height(), result); |
| 186 return true; | 186 return true; |
| 187 } | 187 } |
| 188 | 188 |
| 189 #endif | 189 #endif |
| 190 | 190 |
| OLD | NEW |