OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 #include "SampleCode.h" | 7 #include "SampleCode.h" |
8 #include "SkAlphaThresholdFilter.h" | 8 #include "SkAlphaThresholdFilter.h" |
9 #include "SkBitmapSource.h" | 9 #include "SkBitmapSource.h" |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) : | 334 make_scalar(true), make_scalar(true), R(10.0f), make_scalar()) : |
335 SkPerlinNoiseShader::CreateTurbulence( | 335 SkPerlinNoiseShader::CreateTurbulence( |
336 make_scalar(true), make_scalar(true), R(10.0f), make_scalar())); | 336 make_scalar(true), make_scalar(true), R(10.0f), make_scalar())); |
337 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), | 337 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), |
338 SkIntToScalar(kBitmapSize))
); | 338 SkIntToScalar(kBitmapSize))
); |
339 filter = SkRectShaderImageFilter::Create(shader, &cropR); | 339 filter = SkRectShaderImageFilter::Create(shader, &cropR); |
340 } | 340 } |
341 break; | 341 break; |
342 case DROP_SHADOW: | 342 case DROP_SHADOW: |
343 filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(), | 343 filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(), |
344 make_scalar(true), make_color(), make_image_filter()); | 344 make_scalar(true), make_scalar(true), make_color(), make_im
age_filter()); |
345 break; | 345 break; |
346 case MORPHOLOGY: | 346 case MORPHOLOGY: |
347 if (R(2) == 1) { | 347 if (R(2) == 1) { |
348 filter = SkDilateImageFilter::Create(R(static_cast<float>(kBitmapSiz
e)), | 348 filter = SkDilateImageFilter::Create(R(static_cast<float>(kBitmapSiz
e)), |
349 R(static_cast<float>(kBitmapSize)), make_image_filter()); | 349 R(static_cast<float>(kBitmapSize)), make_image_filter()); |
350 } else { | 350 } else { |
351 filter = SkErodeImageFilter::Create(R(static_cast<float>(kBitmapSize
)), | 351 filter = SkErodeImageFilter::Create(R(static_cast<float>(kBitmapSize
)), |
352 R(static_cast<float>(kBitmapSize)), make_image_filter()); | 352 R(static_cast<float>(kBitmapSize)), make_image_filter()); |
353 } | 353 } |
354 break; | 354 break; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 } | 473 } |
474 | 474 |
475 private: | 475 private: |
476 typedef SkView INHERITED; | 476 typedef SkView INHERITED; |
477 }; | 477 }; |
478 | 478 |
479 ////////////////////////////////////////////////////////////////////////////// | 479 ////////////////////////////////////////////////////////////////////////////// |
480 | 480 |
481 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 481 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
482 static SkViewRegister reg(MyFactory); | 482 static SkViewRegister reg(MyFactory); |
OLD | NEW |