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

Side by Side Diff: gm/imagefilterstransformed.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/imagefiltersscaled.cpp ('k') | gm/imagescalealigned.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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // This GM draws image filters with a CTM containing shearing / rotation. 23 // This GM draws image filters with a CTM containing shearing / rotation.
24 // It checks that the scale portion of the CTM is correctly extracted 24 // It checks that the scale portion of the CTM is correctly extracted
25 // and applied to the image inputs separately from the non-scale portion. 25 // and applied to the image inputs separately from the non-scale portion.
26 26
27 static sk_sp<SkImage> make_gradient_circle(int width, int height) { 27 static sk_sp<SkImage> make_gradient_circle(int width, int height) {
28 SkScalar x = SkIntToScalar(width / 2); 28 SkScalar x = SkIntToScalar(width / 2);
29 SkScalar y = SkIntToScalar(height / 2); 29 SkScalar y = SkIntToScalar(height / 2);
30 SkScalar radius = SkMinScalar(x, y) * 0.8f; 30 SkScalar radius = SkMinScalar(x, y) * 0.8f;
31 31
32 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(width, height) ); 32 auto surface(SkSurface::MakeRasterN32Premul(width, height));
33 SkCanvas* canvas = surface->getCanvas(); 33 SkCanvas* canvas = surface->getCanvas();
34 34
35 canvas->clear(0x00000000); 35 canvas->clear(0x00000000);
36 SkColor colors[2]; 36 SkColor colors[2];
37 colors[0] = SK_ColorWHITE; 37 colors[0] = SK_ColorWHITE;
38 colors[1] = SK_ColorBLACK; 38 colors[1] = SK_ColorBLACK;
39 SkPaint paint; 39 SkPaint paint;
40 paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(x, y), radius, co lors, nullptr, 2, 40 paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(x, y), radius, co lors, nullptr, 2,
41 SkShader::kClamp_TileMode)); 41 SkShader::kClamp_TileMode));
42 canvas->drawCircle(x, y, radius, paint); 42 canvas->drawCircle(x, y, radius, paint);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 sk_sp<SkImage> fCheckerboard; 116 sk_sp<SkImage> fCheckerboard;
117 sk_sp<SkImage> fGradientCircle; 117 sk_sp<SkImage> fGradientCircle;
118 typedef GM INHERITED; 118 typedef GM INHERITED;
119 }; 119 };
120 120
121 ////////////////////////////////////////////////////////////////////////////// 121 //////////////////////////////////////////////////////////////////////////////
122 122
123 DEF_GM( return new ImageFiltersTransformedGM; ) 123 DEF_GM( return new ImageFiltersTransformedGM; )
124 124
125 } 125 }
OLDNEW
« no previous file with comments | « gm/imagefiltersscaled.cpp ('k') | gm/imagescalealigned.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698