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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 } | 203 } |
204 | 204 |
205 GrGLFragmentProcessor* GrMagnifierEffect::createGLInstance() const { | 205 GrGLFragmentProcessor* GrMagnifierEffect::createGLInstance() const { |
206 return SkNEW_ARGS(GrGLMagnifierEffect, (*this)); | 206 return SkNEW_ARGS(GrGLMagnifierEffect, (*this)); |
207 } | 207 } |
208 | 208 |
209 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect); | 209 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect); |
210 | 210 |
211 GrFragmentProcessor* GrMagnifierEffect::TestCreate(SkRandom* random, | 211 GrFragmentProcessor* GrMagnifierEffect::TestCreate(SkRandom* random, |
212 GrContext* context, | 212 GrContext* context, |
213 const GrDrawTargetCaps&, | 213 const GrCaps&, |
214 GrTexture** textures) { | 214 GrTexture** textures) { |
215 GrTexture* texture = textures[0]; | 215 GrTexture* texture = textures[0]; |
216 const int kMaxWidth = 200; | 216 const int kMaxWidth = 200; |
217 const int kMaxHeight = 200; | 217 const int kMaxHeight = 200; |
218 const int kMaxInset = 20; | 218 const int kMaxInset = 20; |
219 uint32_t width = random->nextULessThan(kMaxWidth); | 219 uint32_t width = random->nextULessThan(kMaxWidth); |
220 uint32_t height = random->nextULessThan(kMaxHeight); | 220 uint32_t height = random->nextULessThan(kMaxHeight); |
221 uint32_t x = random->nextULessThan(kMaxWidth - width); | 221 uint32_t x = random->nextULessThan(kMaxWidth - width); |
222 uint32_t y = random->nextULessThan(kMaxHeight - height); | 222 uint32_t y = random->nextULessThan(kMaxHeight - height); |
223 uint32_t inset = random->nextULessThan(kMaxInset); | 223 uint32_t inset = random->nextULessThan(kMaxInset); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 385 |
386 #ifndef SK_IGNORE_TO_STRING | 386 #ifndef SK_IGNORE_TO_STRING |
387 void SkMagnifierImageFilter::toString(SkString* str) const { | 387 void SkMagnifierImageFilter::toString(SkString* str) const { |
388 str->appendf("SkMagnifierImageFilter: ("); | 388 str->appendf("SkMagnifierImageFilter: ("); |
389 str->appendf("src: (%f,%f,%f,%f) ", | 389 str->appendf("src: (%f,%f,%f,%f) ", |
390 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m); | 390 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m); |
391 str->appendf("inset: %f", fInset); | 391 str->appendf("inset: %f", fInset); |
392 str->append(")"); | 392 str->append(")"); |
393 } | 393 } |
394 #endif | 394 #endif |
OLD | NEW |