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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 typedef GrGLMagnifierEffect GLEffect; | 59 typedef GrGLMagnifierEffect GLEffect; |
60 | 60 |
61 private: | 61 private: |
62 GrMagnifierEffect(GrTexture* texture, | 62 GrMagnifierEffect(GrTexture* texture, |
63 float xOffset, | 63 float xOffset, |
64 float yOffset, | 64 float yOffset, |
65 float xInvZoom, | 65 float xInvZoom, |
66 float yInvZoom, | 66 float yInvZoom, |
67 float xInvInset, | 67 float xInvInset, |
68 float yInvInset) | 68 float yInvInset) |
69 : GrSingleTextureEffect(texture, MakeDivByTextureWHMatrix(texture)) | 69 : GrSingleTextureEffect(texture, GrCoordTransform::MakeDivByTextureWHMat
rix(texture)) |
70 , fXOffset(xOffset) | 70 , fXOffset(xOffset) |
71 , fYOffset(yOffset) | 71 , fYOffset(yOffset) |
72 , fXInvZoom(xInvZoom) | 72 , fXInvZoom(xInvZoom) |
73 , fYInvZoom(yInvZoom) | 73 , fYInvZoom(yInvZoom) |
74 , fXInvInset(xInvInset) | 74 , fXInvInset(xInvInset) |
75 , fYInvInset(yInvInset) {} | 75 , fYInvInset(yInvInset) {} |
76 | 76 |
77 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; | 77 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
78 | 78 |
79 GR_DECLARE_EFFECT_TEST; | 79 GR_DECLARE_EFFECT_TEST; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 364 |
365 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); | 365 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); |
366 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); | 366 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); |
367 | 367 |
368 *dptr = sptr[y_val * width + x_val]; | 368 *dptr = sptr[y_val * width + x_val]; |
369 dptr++; | 369 dptr++; |
370 } | 370 } |
371 } | 371 } |
372 return true; | 372 return true; |
373 } | 373 } |
OLD | NEW |