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

Side by Side Diff: gm/colortypexfermode.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 6 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/colortype.cpp ('k') | gm/colorwheel.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 2014 Google Inc. 2 * Copyright 2014 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 "gm.h" 7 #include "gm.h"
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 16 matching lines...) Expand all
27 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, 27 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE,
28 SK_ColorMAGENTA, SK_ColorCYAN, SK_ColorYELLOW 28 SK_ColorMAGENTA, SK_ColorCYAN, SK_ColorYELLOW
29 }; 29 };
30 SkMatrix local; 30 SkMatrix local;
31 local.setRotate(180); 31 local.setRotate(180);
32 SkPaint paint; 32 SkPaint paint;
33 paint.setAntiAlias(true); 33 paint.setAntiAlias(true);
34 paint.setShader(SkGradientShader::MakeSweep(0, 0, colors, nullptr, SK_AR RAY_COUNT(colors), 34 paint.setShader(SkGradientShader::MakeSweep(0, 0, colors, nullptr, SK_AR RAY_COUNT(colors),
35 0, &local)); 35 0, &local));
36 36
37 sk_sp<SkTypeface> orig(sk_tool_utils::create_portable_typeface("serif", SkTypeface::kBold)); 37 sk_sp<SkTypeface> orig(sk_tool_utils::create_portable_typeface("serif",
38 SkFontStyle::FromOldStyle(SkTypeface::kBold)) );
38 if (nullptr == orig) { 39 if (nullptr == orig) {
39 orig = SkTypeface::MakeDefault(); 40 orig = SkTypeface::MakeDefault();
40 } 41 }
41 fColorType = sk_make_sp<SkGTypeface>(orig, paint); 42 fColorType = sk_make_sp<SkGTypeface>(orig, paint);
42 43
43 fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, 44 fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType,
44 kOpaque_SkAlphaType), gData, 4); 45 kOpaque_SkAlphaType), gData, 4);
45 } 46 }
46 47
47 virtual SkString onShortName() override { 48 virtual SkString onShortName() override {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 148
148 typedef GM INHERITED; 149 typedef GM INHERITED;
149 }; 150 };
150 151
151 ////////////////////////////////////////////////////////////////////////////// 152 //////////////////////////////////////////////////////////////////////////////
152 153
153 static GM* MyFactory(void*) { return new ColorTypeXfermodeGM; } 154 static GM* MyFactory(void*) { return new ColorTypeXfermodeGM; }
154 static GMRegistry reg(MyFactory); 155 static GMRegistry reg(MyFactory);
155 156
156 } 157 }
OLDNEW
« no previous file with comments | « gm/colortype.cpp ('k') | gm/colorwheel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698