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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 { | 304 { |
305 SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(make_xfermode())); | 305 SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(make_xfermode())); |
306 filter = SkXfermodeImageFilter::Create(mode, make_image_filter(), make_i
mage_filter()); | 306 filter = SkXfermodeImageFilter::Create(mode, make_image_filter(), make_i
mage_filter()); |
307 } | 307 } |
308 break; | 308 break; |
309 case OFFSET: | 309 case OFFSET: |
310 filter = SkOffsetImageFilter::Create(make_scalar(), make_scalar(), make_
image_filter()); | 310 filter = SkOffsetImageFilter::Create(make_scalar(), make_scalar(), make_
image_filter()); |
311 break; | 311 break; |
312 case MATRIX: | 312 case MATRIX: |
313 filter = SkMatrixImageFilter::Create(make_matrix(), | 313 filter = SkMatrixImageFilter::Create(make_matrix(), |
314 (SkPaint::FilterLevel)R(4), | 314 (SkFilterQuality)R(4), |
315 make_image_filter()); | 315 make_image_filter()); |
316 break; | 316 break; |
317 case MATRIX_CONVOLUTION: | 317 case MATRIX_CONVOLUTION: |
318 { | 318 { |
319 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), | 319 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), |
320 SkIntToScalar(kBitmapSize))
); | 320 SkIntToScalar(kBitmapSize))
); |
321 SkISize size = SkISize::Make(R(10)+1, R(10)+1); | 321 SkISize size = SkISize::Make(R(10)+1, R(10)+1); |
322 int arraySize = size.width() * size.height(); | 322 int arraySize = size.width() * size.height(); |
323 SkTArray<SkScalar> kernel(arraySize); | 323 SkTArray<SkScalar> kernel(arraySize); |
324 for (int i = 0; i < arraySize; ++i) { | 324 for (int i = 0; i < arraySize; ++i) { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 } | 514 } |
515 | 515 |
516 private: | 516 private: |
517 typedef SkView INHERITED; | 517 typedef SkView INHERITED; |
518 }; | 518 }; |
519 | 519 |
520 ////////////////////////////////////////////////////////////////////////////// | 520 ////////////////////////////////////////////////////////////////////////////// |
521 | 521 |
522 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 522 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
523 static SkViewRegister reg(MyFactory); | 523 static SkViewRegister reg(MyFactory); |
OLD | NEW |