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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 desc.fWidth = src.width(); | 160 desc.fWidth = src.width(); |
161 desc.fHeight = src.height(); | 161 desc.fHeight = src.height(); |
162 desc.fConfig = kSkia8888_GrPixelConfig; | 162 desc.fConfig = kSkia8888_GrPixelConfig; |
163 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture( | 163 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture( |
164 desc, GrTextureProvider::kApprox_ScratchTexMatch)); | 164 desc, GrTextureProvider::kApprox_ScratchTexMatch)); |
165 if (!dst) { | 165 if (!dst) { |
166 return false; | 166 return false; |
167 } | 167 } |
168 | 168 |
169 GrPaint paint; | 169 GrPaint paint; |
170 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, paint.getShaderDat
aManager(), | 170 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, paint.getProcessor
DataManager(), |
171 backgroundTex)) { | 171 backgroundTex)) { |
172 // canFilterImageGPU() should've taken care of this | 172 // canFilterImageGPU() should've taken care of this |
173 SkASSERT(false); | 173 SkASSERT(false); |
174 return false; | 174 return false; |
175 } | 175 } |
176 | 176 |
177 SkMatrix foregroundMatrix = GrCoordTransform::MakeDivByTextureWHMatrix(foreg
roundTex); | 177 SkMatrix foregroundMatrix = GrCoordTransform::MakeDivByTextureWHMatrix(foreg
roundTex); |
178 foregroundMatrix.preTranslate(SkIntToScalar(backgroundOffset.fX-foregroundOf
fset.fX), | 178 foregroundMatrix.preTranslate(SkIntToScalar(backgroundOffset.fX-foregroundOf
fset.fX), |
179 SkIntToScalar(backgroundOffset.fY-foregroundOf
fset.fY)); | 179 SkIntToScalar(backgroundOffset.fY-foregroundOf
fset.fY)); |
180 | 180 |
(...skipping 20 matching lines...) Expand all Loading... |
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 |