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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 GrTexture* backgroundTex = background.getTexture(); | 117 GrTexture* backgroundTex = background.getTexture(); |
118 SkBitmap foreground = src; | 118 SkBitmap foreground = src; |
119 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); | 119 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); |
120 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro
und, | 120 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro
und, |
121 &foregroundOffset)) { | 121 &foregroundOffset)) { |
122 return onFilterImage(proxy, src, ctx, result, offset); | 122 return onFilterImage(proxy, src, ctx, result, offset); |
123 } | 123 } |
124 GrTexture* foregroundTex = foreground.getTexture(); | 124 GrTexture* foregroundTex = foreground.getTexture(); |
125 GrContext* context = foregroundTex->getContext(); | 125 GrContext* context = foregroundTex->getContext(); |
126 | 126 |
127 GrEffectRef* xferEffect = NULL; | 127 GrEffect* xferEffect = NULL; |
128 | 128 |
129 GrTextureDesc desc; | 129 GrTextureDesc desc; |
130 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; | 130 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; |
131 desc.fWidth = src.width(); | 131 desc.fWidth = src.width(); |
132 desc.fHeight = src.height(); | 132 desc.fHeight = src.height(); |
133 desc.fConfig = kSkia8888_GrPixelConfig; | 133 desc.fConfig = kSkia8888_GrPixelConfig; |
134 | 134 |
135 GrAutoScratchTexture ast(context, desc); | 135 GrAutoScratchTexture ast(context, desc); |
136 SkAutoTUnref<GrTexture> dst(ast.detach()); | 136 SkAutoTUnref<GrTexture> dst(ast.detach()); |
137 | 137 |
(...skipping 18 matching lines...) Expand all Loading... |
156 paint.addColorEffect(xferEffect)->unref(); | 156 paint.addColorEffect(xferEffect)->unref(); |
157 context->drawRect(paint, srcRect); | 157 context->drawRect(paint, srcRect); |
158 | 158 |
159 offset->fX = backgroundOffset.fX; | 159 offset->fX = backgroundOffset.fX; |
160 offset->fY = backgroundOffset.fY; | 160 offset->fY = backgroundOffset.fY; |
161 WrapTexture(dst, src.width(), src.height(), result); | 161 WrapTexture(dst, src.width(), src.height(), result); |
162 return true; | 162 return true; |
163 } | 163 } |
164 | 164 |
165 #endif | 165 #endif |
OLD | NEW |