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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 filter = SkTileImageFilter::Create(make_rect(), make_rect(), make_image_
filter(false)); | 705 filter = SkTileImageFilter::Create(make_rect(), make_rect(), make_image_
filter(false)); |
706 break; | 706 break; |
707 case PICTURE: | 707 case PICTURE: |
708 { | 708 { |
709 SkRTreeFactory factory; | 709 SkRTreeFactory factory; |
710 SkPictureRecorder recorder; | 710 SkPictureRecorder recorder; |
711 SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(kBitma
pSize), | 711 SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(kBitma
pSize), |
712 SkIntToScalar(kBitma
pSize), | 712 SkIntToScalar(kBitma
pSize), |
713 &factory, 0); | 713 &factory, 0); |
714 drawSomething(recordingCanvas); | 714 drawSomething(recordingCanvas); |
715 SkAutoTUnref<SkPicture> pict(recorder.endRecording()); | 715 sk_sp<SkPicture> pict(recorder.finishRecordingAsPicture()); |
716 filter = SkPictureImageFilter::Create(pict.get(), make_rect()); | 716 filter = SkPictureImageFilter::Create(pict.get(), make_rect()); |
717 } | 717 } |
718 break; | 718 break; |
719 case PAINT: | 719 case PAINT: |
720 { | 720 { |
721 SkImageFilter::CropRect cropR(make_rect()); | 721 SkImageFilter::CropRect cropR(make_rect()); |
722 filter = SkPaintImageFilter::Create(make_paint(), &cropR); | 722 filter = SkPaintImageFilter::Create(make_paint(), &cropR); |
723 } | 723 } |
724 default: | 724 default: |
725 break; | 725 break; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 } | 817 } |
818 | 818 |
819 private: | 819 private: |
820 typedef SkView INHERITED; | 820 typedef SkView INHERITED; |
821 }; | 821 }; |
822 | 822 |
823 ////////////////////////////////////////////////////////////////////////////// | 823 ////////////////////////////////////////////////////////////////////////////// |
824 | 824 |
825 static SkView* MyFactory() { return new ImageFilterFuzzView; } | 825 static SkView* MyFactory() { return new ImageFilterFuzzView; } |
826 static SkViewRegister reg(MyFactory); | 826 static SkViewRegister reg(MyFactory); |
OLD | NEW |