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

Side by Side Diff: gm/bigtileimagefilter.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 | « example/HelloWorld.h ('k') | gm/color4f.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 "SkImageSource.h" 8 #include "SkImageSource.h"
9 #include "SkSurface.h" 9 #include "SkSurface.h"
10 #include "SkTileImageFilter.h" 10 #include "SkTileImageFilter.h"
11 #include "gm.h" 11 #include "gm.h"
12 12
13 static sk_sp<SkImage> create_circle_texture(int size, SkColor color) { 13 static sk_sp<SkImage> create_circle_texture(int size, SkColor color) {
14 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(size, size)); 14 auto surface(SkSurface::MakeRasterN32Premul(size, size));
15 SkCanvas* canvas = surface->getCanvas(); 15 SkCanvas* canvas = surface->getCanvas();
16 canvas->clear(0xFF000000); 16 canvas->clear(0xFF000000);
17 17
18 SkPaint paint; 18 SkPaint paint;
19 paint.setColor(color); 19 paint.setColor(color);
20 paint.setStrokeWidth(3); 20 paint.setStrokeWidth(3);
21 paint.setStyle(SkPaint::kStroke_Style); 21 paint.setStyle(SkPaint::kStroke_Style);
22 22
23 canvas->drawCircle(SkScalarHalf(size), SkScalarHalf(size), SkScalarHalf(size ), paint); 23 canvas->drawCircle(SkScalarHalf(size), SkScalarHalf(size), SkScalarHalf(size ), paint);
24 24
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 sk_sp<SkImage> fRedImage; 98 sk_sp<SkImage> fRedImage;
99 sk_sp<SkImage> fGreenImage; 99 sk_sp<SkImage> fGreenImage;
100 100
101 typedef GM INHERITED; 101 typedef GM INHERITED;
102 }; 102 };
103 103
104 ////////////////////////////////////////////////////////////////////////////// 104 //////////////////////////////////////////////////////////////////////////////
105 105
106 DEF_GM(return new BigTileImageFilterGM;) 106 DEF_GM(return new BigTileImageFilterGM;)
107 } 107 }
OLDNEW
« no previous file with comments | « example/HelloWorld.h ('k') | gm/color4f.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698