Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SampleArc.cpp ('k') | samplecode/SampleHT.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« no previous file with comments | « samplecode/SampleArc.cpp ('k') | samplecode/SampleHT.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698