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

Side by Side Diff: gm/localmatriximagefilter.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « gm/lcdblendmodes.cpp ('k') | gm/mipmap.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 2015 Google Inc. 2 * Copyright 2015 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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
11 #include "SkColorFilterImageFilter.h" 11 #include "SkColorFilterImageFilter.h"
12 #include "SkModeColorFilter.h" 12 #include "SkModeColorFilter.h"
13 #include "SkMorphologyImageFilter.h" 13 #include "SkMorphologyImageFilter.h"
14 #include "SkOffsetImageFilter.h" 14 #include "SkOffsetImageFilter.h"
15 #include "SkSurface.h" 15 #include "SkSurface.h"
16 16
17 static sk_sp<SkImage> make_image(SkCanvas* rootCanvas) { 17 static sk_sp<SkImage> make_image(SkCanvas* rootCanvas) {
18 SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); 18 SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100);
19 SkAutoTUnref<SkSurface> surface(rootCanvas->newSurface(info)); 19 auto surface(rootCanvas->makeSurface(info));
20 if (!surface) { 20 if (!surface) {
21 surface.reset(SkSurface::NewRaster(info)); 21 surface = SkSurface::MakeRaster(info);
22 } 22 }
23 23
24 SkPaint paint; 24 SkPaint paint;
25 paint.setAntiAlias(true); 25 paint.setAntiAlias(true);
26 paint.setColor(SK_ColorRED); 26 paint.setColor(SK_ColorRED);
27 surface->getCanvas()->drawCircle(50, 50, 50, paint); 27 surface->getCanvas()->drawCircle(50, 50, 50, paint);
28 return surface->makeImageSnapshot(); 28 return surface->makeImageSnapshot();
29 } 29 }
30 30
31 typedef SkImageFilter* (*ImageFilterFactory)(); 31 typedef SkImageFilter* (*ImageFilterFactory)();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 canvas->restore(); 93 canvas->restore();
94 canvas->translate(0, spacer); 94 canvas->translate(0, spacer);
95 } 95 }
96 } 96 }
97 97
98 private: 98 private:
99 typedef GM INHERITED; 99 typedef GM INHERITED;
100 }; 100 };
101 DEF_GM( return new LocalMatrixImageFilterGM; ) 101 DEF_GM( return new LocalMatrixImageFilterGM; )
102 102
OLDNEW
« no previous file with comments | « gm/lcdblendmodes.cpp ('k') | gm/mipmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698