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" |
11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
12 #include "SkWriteBuffer.h" | 12 #include "SkWriteBuffer.h" |
13 #include "SkValidationUtils.h" | 13 #include "SkValidationUtils.h" |
14 | 14 |
15 //////////////////////////////////////////////////////////////////////////////// | 15 //////////////////////////////////////////////////////////////////////////////// |
16 #if SK_SUPPORT_GPU | 16 #if SK_SUPPORT_GPU |
17 #include "effects/GrSingleTextureEffect.h" | 17 #include "effects/GrSingleTextureEffect.h" |
18 #include "gl/GrGLEffect.h" | 18 #include "gl/GrGLEffect.h" |
| 19 #include "gl/GrGLShaderBuilder.h" |
19 #include "gl/GrGLSL.h" | 20 #include "gl/GrGLSL.h" |
20 #include "gl/GrGLTexture.h" | 21 #include "gl/GrGLTexture.h" |
21 #include "GrTBackendEffectFactory.h" | 22 #include "GrTBackendEffectFactory.h" |
22 | 23 |
23 class GrGLMagnifierEffect; | 24 class GrGLMagnifierEffect; |
24 | 25 |
25 class GrMagnifierEffect : public GrSingleTextureEffect { | 26 class GrMagnifierEffect : public GrSingleTextureEffect { |
26 | 27 |
27 public: | 28 public: |
28 static GrEffect* Create(GrTexture* texture, | 29 static GrEffect* Create(GrTexture* texture, |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 342 |
342 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); | 343 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); |
343 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); | 344 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); |
344 | 345 |
345 *dptr = sptr[y_val * width + x_val]; | 346 *dptr = sptr[y_val * width + x_val]; |
346 dptr++; | 347 dptr++; |
347 } | 348 } |
348 } | 349 } |
349 return true; | 350 return true; |
350 } | 351 } |
OLD | NEW |