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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 make_channel_selector_type(), m
ake_scalar(), | 689 make_channel_selector_type(), m
ake_scalar(), |
690 make_image_filter(false), make_
image_filter()); | 690 make_image_filter(false), make_
image_filter()); |
691 break; | 691 break; |
692 case TILE: | 692 case TILE: |
693 filter = SkTileImageFilter::Create(make_rect(), make_rect(), make_image_
filter(false)); | 693 filter = SkTileImageFilter::Create(make_rect(), make_rect(), make_image_
filter(false)); |
694 break; | 694 break; |
695 case PICTURE: | 695 case PICTURE: |
696 { | 696 { |
697 SkRTreeFactory factory; | 697 SkRTreeFactory factory; |
698 SkPictureRecorder recorder; | 698 SkPictureRecorder recorder; |
699 SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(kBitma
pSize), | 699 SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(kBitma
pSize), |
700 SkIntToScalar(kBitma
pSize), | 700 SkIntToScalar(kBitma
pSize), |
701 &factory, 0); | 701 &factory, 0); |
702 drawSomething(recordingCanvas); | 702 drawSomething(recordingCanvas); |
703 sk_sp<SkPicture> pict(recorder.finishRecordingAsPicture()); | 703 sk_sp<SkPicture> pict(recorder.finishRecordingAsPicture()); |
704 filter = SkPictureImageFilter::Make(pict, make_rect()).release(); | 704 filter = SkPictureImageFilter::Make(pict, make_rect()).release(); |
705 } | 705 } |
706 break; | 706 break; |
707 case PAINT: | 707 case PAINT: |
708 { | 708 { |
709 SkImageFilter::CropRect cropR(make_rect()); | 709 SkImageFilter::CropRect cropR(make_rect()); |
710 filter = SkPaintImageFilter::Create(make_paint(), &cropR); | 710 filter = SkPaintImageFilter::Create(make_paint(), &cropR); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 } | 805 } |
806 | 806 |
807 private: | 807 private: |
808 typedef SkView INHERITED; | 808 typedef SkView INHERITED; |
809 }; | 809 }; |
810 | 810 |
811 ////////////////////////////////////////////////////////////////////////////// | 811 ////////////////////////////////////////////////////////////////////////////// |
812 | 812 |
813 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 813 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
814 static SkViewRegister reg(MyFactory); | 814 static SkViewRegister reg(MyFactory); |
OLD | NEW |