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 "SkBicubicImageFilter.h" | 8 #include "SkBicubicImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 UniformHandle fImageIncrementUni; | 208 UniformHandle fImageIncrementUni; |
209 | 209 |
210 GrGLEffectMatrix fEffectMatrix; | 210 GrGLEffectMatrix fEffectMatrix; |
211 | 211 |
212 typedef GrGLEffect INHERITED; | 212 typedef GrGLEffect INHERITED; |
213 }; | 213 }; |
214 | 214 |
215 GrGLBicubicEffect::GrGLBicubicEffect(const GrBackendEffectFactory& factory, | 215 GrGLBicubicEffect::GrGLBicubicEffect(const GrBackendEffectFactory& factory, |
216 const GrDrawEffect& drawEffect) | 216 const GrDrawEffect& drawEffect) |
217 : INHERITED(factory) | 217 : INHERITED(factory) |
218 , fCoefficientsUni(GrGLUniformManager::kInvalidUniformHandle) | |
219 , fImageIncrementUni(GrGLUniformManager::kInvalidUniformHandle) | |
220 , fEffectMatrix(drawEffect.castEffect<GrBicubicEffect>().coordsType()) { | 218 , fEffectMatrix(drawEffect.castEffect<GrBicubicEffect>().coordsType()) { |
221 } | 219 } |
222 | 220 |
223 void GrGLBicubicEffect::emitCode(GrGLShaderBuilder* builder, | 221 void GrGLBicubicEffect::emitCode(GrGLShaderBuilder* builder, |
224 const GrDrawEffect&, | 222 const GrDrawEffect&, |
225 EffectKey key, | 223 EffectKey key, |
226 const char* outputColor, | 224 const char* outputColor, |
227 const char* inputColor, | 225 const char* inputColor, |
228 const TextureSamplerArray& samplers) { | 226 const TextureSamplerArray& samplers) { |
229 const char* coords; | 227 const char* coords; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 GrPaint paint; | 366 GrPaint paint; |
369 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un
ref(); | 367 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un
ref(); |
370 SkRect srcRect; | 368 SkRect srcRect; |
371 srcBM.getBounds(&srcRect); | 369 srcBM.getBounds(&srcRect); |
372 context->drawRectToRect(paint, dstRect, srcRect); | 370 context->drawRectToRect(paint, dstRect, srcRect); |
373 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul
t); | 371 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul
t); |
374 } | 372 } |
375 #endif | 373 #endif |
376 | 374 |
377 /////////////////////////////////////////////////////////////////////////////// | 375 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |