| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 return GrGLEffectMatrix::GenKey(zoom.getMatrix(), | 189 return GrGLEffectMatrix::GenKey(zoom.getMatrix(), |
| 190 drawEffect, | 190 drawEffect, |
| 191 zoom.coordsType(), | 191 zoom.coordsType(), |
| 192 zoom.texture(0)); | 192 zoom.texture(0)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 ///////////////////////////////////////////////////////////////////// | 195 ///////////////////////////////////////////////////////////////////// |
| 196 | 196 |
| 197 GR_DEFINE_EFFECT_TEST(GrMagnifierEffect); | 197 GR_DEFINE_EFFECT_TEST(GrMagnifierEffect); |
| 198 | 198 |
| 199 GrEffectRef* GrMagnifierEffect::TestCreate(SkMWCRandom* random, | 199 GrEffectRef* GrMagnifierEffect::TestCreate(SkRandom* random, |
| 200 GrContext* context, | 200 GrContext* context, |
| 201 const GrDrawTargetCaps&, | 201 const GrDrawTargetCaps&, |
| 202 GrTexture** textures) { | 202 GrTexture** textures) { |
| 203 const int kMaxWidth = 200; | 203 const int kMaxWidth = 200; |
| 204 const int kMaxHeight = 200; | 204 const int kMaxHeight = 200; |
| 205 const int kMaxInset = 20; | 205 const int kMaxInset = 20; |
| 206 uint32_t width = random->nextULessThan(kMaxWidth); | 206 uint32_t width = random->nextULessThan(kMaxWidth); |
| 207 uint32_t height = random->nextULessThan(kMaxHeight); | 207 uint32_t height = random->nextULessThan(kMaxHeight); |
| 208 uint32_t x = random->nextULessThan(kMaxWidth - width); | 208 uint32_t x = random->nextULessThan(kMaxWidth - width); |
| 209 uint32_t y = random->nextULessThan(kMaxHeight - height); | 209 uint32_t y = random->nextULessThan(kMaxHeight - height); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); | 343 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); |
| 344 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); | 344 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); |
| 345 | 345 |
| 346 *dptr = sptr[y_val * width + x_val]; | 346 *dptr = sptr[y_val * width + x_val]; |
| 347 dptr++; | 347 dptr++; |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 return true; | 350 return true; |
| 351 } | 351 } |
| OLD | NEW |