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

Side by Side Diff: gm/convexpolyclip.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container 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/constcolorprocessor.cpp ('k') | gm/drawbitmaprect.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "gm.h" 9 #include "gm.h"
10 10
(...skipping 26 matching lines...) Expand all
37 2 * SK_Scalar1 / 6, 37 2 * SK_Scalar1 / 6,
38 3 * SK_Scalar1 / 6, 38 3 * SK_Scalar1 / 6,
39 4 * SK_Scalar1 / 6, 39 4 * SK_Scalar1 / 6,
40 5 * SK_Scalar1 / 6, 40 5 * SK_Scalar1 / 6,
41 SK_Scalar1}; 41 SK_Scalar1};
42 42
43 SkPaint paint; 43 SkPaint paint;
44 SkRect rect = SkRect::MakeWH(wScalar, hScalar); 44 SkRect rect = SkRect::MakeWH(wScalar, hScalar);
45 SkMatrix mat = SkMatrix::I(); 45 SkMatrix mat = SkMatrix::I();
46 for (int i = 0; i < 4; ++i) { 46 for (int i = 0; i < 4; ++i) {
47 paint.setShader(SkGradientShader::CreateRadial( 47 paint.setShader(SkGradientShader::MakeRadial(
48 pt, radius, 48 pt, radius,
49 colors, pos, 49 colors, pos,
50 SK_ARRAY_COUNT(colors), 50 SK_ARRAY_COUNT(colors),
51 SkShader::kRepeat_TileMode, 51 SkShader::kRepeat_TileMode,
52 0, &mat))->unref(); 52 0, &mat));
53 canvas.drawRect(rect, paint); 53 canvas.drawRect(rect, paint);
54 rect.inset(wScalar / 8, hScalar / 8); 54 rect.inset(wScalar / 8, hScalar / 8);
55 mat.preTranslate(6 * wScalar, 6 * hScalar); 55 mat.preTranslate(6 * wScalar, 6 * hScalar);
56 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); 56 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3);
57 } 57 }
58 58
59 paint.setAntiAlias(true); 59 paint.setAntiAlias(true);
60 sk_tool_utils::set_portable_typeface(&paint); 60 sk_tool_utils::set_portable_typeface(&paint);
61 paint.setTextSize(wScalar / 2.2f); 61 paint.setTextSize(wScalar / 2.2f);
62 paint.setShader(0); 62 paint.setShader(0);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 typedef SkTLList<Clip, 1> ClipList; 294 typedef SkTLList<Clip, 1> ClipList;
295 ClipList fClips; 295 ClipList fClips;
296 SkBitmap fBmp; 296 SkBitmap fBmp;
297 297
298 typedef GM INHERITED; 298 typedef GM INHERITED;
299 }; 299 };
300 300
301 DEF_GM(return new ConvexPolyClip;) 301 DEF_GM(return new ConvexPolyClip;)
302 } 302 }
OLDNEW
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698