| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkMagnifierImageFilter.h" | 9 #include "SkMagnifierImageFilter.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 UniformHandle fInsetVar; | 111 UniformHandle fInsetVar; |
| 112 | 112 |
| 113 GrGLEffectMatrix fEffectMatrix; | 113 GrGLEffectMatrix fEffectMatrix; |
| 114 | 114 |
| 115 typedef GrGLEffect INHERITED; | 115 typedef GrGLEffect INHERITED; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 GrGLMagnifierEffect::GrGLMagnifierEffect(const GrBackendEffectFactory& factory, | 118 GrGLMagnifierEffect::GrGLMagnifierEffect(const GrBackendEffectFactory& factory, |
| 119 const GrDrawEffect& drawEffect) | 119 const GrDrawEffect& drawEffect) |
| 120 : INHERITED(factory) | 120 : INHERITED(factory) |
| 121 , fOffsetVar(GrGLUniformManager::kInvalidUniformHandle) | |
| 122 , fZoomVar(GrGLUniformManager::kInvalidUniformHandle) | |
| 123 , fInsetVar(GrGLUniformManager::kInvalidUniformHandle) | |
| 124 , fEffectMatrix(drawEffect.castEffect<GrMagnifierEffect>().coordsType()) { | 121 , fEffectMatrix(drawEffect.castEffect<GrMagnifierEffect>().coordsType()) { |
| 125 } | 122 } |
| 126 | 123 |
| 127 void GrGLMagnifierEffect::emitCode(GrGLShaderBuilder* builder, | 124 void GrGLMagnifierEffect::emitCode(GrGLShaderBuilder* builder, |
| 128 const GrDrawEffect&, | 125 const GrDrawEffect&, |
| 129 EffectKey key, | 126 EffectKey key, |
| 130 const char* outputColor, | 127 const char* outputColor, |
| 131 const char* inputColor, | 128 const char* inputColor, |
| 132 const TextureSamplerArray& samplers) { | 129 const TextureSamplerArray& samplers) { |
| 133 const char* coords; | 130 const char* coords; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 342 |
| 346 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); | 343 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); |
| 347 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); | 344 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); |
| 348 | 345 |
| 349 *dptr = sptr[y_val * width + x_val]; | 346 *dptr = sptr[y_val * width + x_val]; |
| 350 dptr++; | 347 dptr++; |
| 351 } | 348 } |
| 352 } | 349 } |
| 353 return true; | 350 return true; |
| 354 } | 351 } |
| OLD | NEW |