| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 GrProcessorKeyBuilder* b) const { | 188 GrProcessorKeyBuilder* b) const { |
| 189 GrGLMagnifierEffect::GenKey(*this, caps, b); | 189 GrGLMagnifierEffect::GenKey(*this, caps, b); |
| 190 } | 190 } |
| 191 | 191 |
| 192 GrGLFragmentProcessor* GrMagnifierEffect::onCreateGLInstance() const { | 192 GrGLFragmentProcessor* GrMagnifierEffect::onCreateGLInstance() const { |
| 193 return new GrGLMagnifierEffect(*this); | 193 return new GrGLMagnifierEffect(*this); |
| 194 } | 194 } |
| 195 | 195 |
| 196 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect); | 196 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect); |
| 197 | 197 |
| 198 GrFragmentProcessor* GrMagnifierEffect::TestCreate(GrProcessorTestData* d) { | 198 const GrFragmentProcessor* GrMagnifierEffect::TestCreate(GrProcessorTestData* d)
{ |
| 199 GrTexture* texture = d->fTextures[0]; | 199 GrTexture* texture = d->fTextures[0]; |
| 200 const int kMaxWidth = 200; | 200 const int kMaxWidth = 200; |
| 201 const int kMaxHeight = 200; | 201 const int kMaxHeight = 200; |
| 202 const int kMaxInset = 20; | 202 const int kMaxInset = 20; |
| 203 uint32_t width = d->fRandom->nextULessThan(kMaxWidth); | 203 uint32_t width = d->fRandom->nextULessThan(kMaxWidth); |
| 204 uint32_t height = d->fRandom->nextULessThan(kMaxHeight); | 204 uint32_t height = d->fRandom->nextULessThan(kMaxHeight); |
| 205 uint32_t x = d->fRandom->nextULessThan(kMaxWidth - width); | 205 uint32_t x = d->fRandom->nextULessThan(kMaxWidth - width); |
| 206 uint32_t y = d->fRandom->nextULessThan(kMaxHeight - height); | 206 uint32_t y = d->fRandom->nextULessThan(kMaxHeight - height); |
| 207 uint32_t inset = d->fRandom->nextULessThan(kMaxInset); | 207 uint32_t inset = d->fRandom->nextULessThan(kMaxInset); |
| 208 | 208 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 #ifndef SK_IGNORE_TO_STRING | 374 #ifndef SK_IGNORE_TO_STRING |
| 375 void SkMagnifierImageFilter::toString(SkString* str) const { | 375 void SkMagnifierImageFilter::toString(SkString* str) const { |
| 376 str->appendf("SkMagnifierImageFilter: ("); | 376 str->appendf("SkMagnifierImageFilter: ("); |
| 377 str->appendf("src: (%f,%f,%f,%f) ", | 377 str->appendf("src: (%f,%f,%f,%f) ", |
| 378 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m); | 378 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m); |
| 379 str->appendf("inset: %f", fInset); | 379 str->appendf("inset: %f", fInset); |
| 380 str->append(")"); | 380 str->append(")"); |
| 381 } | 381 } |
| 382 #endif | 382 #endif |
| OLD | NEW |