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 "Sk1DPathEffect.h" | 8 #include "Sk1DPathEffect.h" |
9 #include "Sk2DPathEffect.h" | 9 #include "Sk2DPathEffect.h" |
10 #include "SkAlphaThresholdFilter.h" | 10 #include "SkAlphaThresholdFilter.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 DOWN_SAMPLE, XFERMODE, OFFSET, MATRIX, MATRIX_CONVOLUTION, COMPOSE, | 552 DOWN_SAMPLE, XFERMODE, OFFSET, MATRIX, MATRIX_CONVOLUTION, COMPOSE, |
553 DISTANT_LIGHT, POINT_LIGHT, SPOT_LIGHT, NOISE, DROP_SHADOW, | 553 DISTANT_LIGHT, POINT_LIGHT, SPOT_LIGHT, NOISE, DROP_SHADOW, |
554 MORPHOLOGY, BITMAP, DISPLACE, TILE, PICTURE, PAINT, NUM_FILTERS }; | 554 MORPHOLOGY, BITMAP, DISPLACE, TILE, PICTURE, PAINT, NUM_FILTERS }; |
555 | 555 |
556 switch (R(NUM_FILTERS)) { | 556 switch (R(NUM_FILTERS)) { |
557 case ALPHA_THRESHOLD: | 557 case ALPHA_THRESHOLD: |
558 filter = sk_sp<SkImageFilter>(SkAlphaThresholdFilter::Create(make_region
(), | 558 filter = sk_sp<SkImageFilter>(SkAlphaThresholdFilter::Create(make_region
(), |
559 make_scalar
(), | 559 make_scalar
(), |
560 make_scalar
())); | 560 make_scalar
())); |
561 break; | 561 break; |
562 case MERGE: { | 562 case MERGE: |
563 sk_sp<SkImageFilter> subFilter1(make_image_filter()); | 563 filter = SkMergeImageFilter::Make(make_image_filter(), |
564 sk_sp<SkImageFilter> subFilter2(make_image_filter()); | 564 make_image_filter(), |
565 filter = sk_sp<SkImageFilter>(SkMergeImageFilter::Create(subFilter1.get(
), | 565 make_xfermode()); |
566 subFilter2.get(
), | |
567 make_xfermode()
)); | |
568 break; | 566 break; |
569 } | |
570 case COLOR: { | 567 case COLOR: { |
571 sk_sp<SkColorFilter> cf(make_color_filter()); | 568 sk_sp<SkColorFilter> cf(make_color_filter()); |
572 sk_sp<SkImageFilter> subFilter(make_image_filter()); | 569 sk_sp<SkImageFilter> subFilter(make_image_filter()); |
573 filter = cf ? sk_sp<SkImageFilter>(SkColorFilterImageFilter::Create(cf.g
et(), | 570 filter = cf ? sk_sp<SkImageFilter>(SkColorFilterImageFilter::Create(cf.g
et(), |
574 subF
ilter.get())) | 571 subF
ilter.get())) |
575 : nullptr; | 572 : nullptr; |
576 break; | 573 break; |
577 } | 574 } |
578 case LUT3D: { | 575 case LUT3D: { |
579 int cubeDimension; | 576 int cubeDimension; |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 } | 869 } |
873 | 870 |
874 private: | 871 private: |
875 typedef SkView INHERITED; | 872 typedef SkView INHERITED; |
876 }; | 873 }; |
877 | 874 |
878 ////////////////////////////////////////////////////////////////////////////// | 875 ////////////////////////////////////////////////////////////////////////////// |
879 | 876 |
880 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 877 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
881 static SkViewRegister reg(MyFactory); | 878 static SkViewRegister reg(MyFactory); |
OLD | NEW |