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

Side by Side Diff: gm/all_bitmap_configs.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 | « fuzz/FilterFuzz.cpp ('k') | gm/colortype.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 "SkSurface.h" 9 #include "SkSurface.h"
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 SkPaint p; 68 SkPaint p;
69 p.setAntiAlias(false); 69 p.setAntiAlias(false);
70 p.setColor(SK_ColorWHITE); 70 p.setColor(SK_ColorWHITE);
71 canvas->drawCircle(0.0f, 0.0f, SCALE * 0.5f, p); 71 canvas->drawCircle(0.0f, 0.0f, SCALE * 0.5f, p);
72 72
73 const double sqrt_3_over_2 = 0.8660254037844387; 73 const double sqrt_3_over_2 = 0.8660254037844387;
74 const SkScalar Z = 0.0f; 74 const SkScalar Z = 0.0f;
75 const SkScalar D = 0.3f * SkIntToScalar(SCALE); 75 const SkScalar D = 0.3f * SkIntToScalar(SCALE);
76 const SkScalar X = SkDoubleToScalar(D * sqrt_3_over_2); 76 const SkScalar X = SkDoubleToScalar(D * sqrt_3_over_2);
77 const SkScalar Y = D * SK_ScalarHalf; 77 const SkScalar Y = D * SK_ScalarHalf;
78 sk_tool_utils::set_portable_typeface(&p, nullptr, SkTypeface::kBold); 78 sk_tool_utils::set_portable_typeface(&p, nullptr, SkFontStyle::FromOldStyle( SkTypeface::kBold));
79 p.setTextSize(0.28125f * SCALE); 79 p.setTextSize(0.28125f * SCALE);
80 draw_center_letter('K', &p, SK_ColorBLACK, Z, Z, canvas); 80 draw_center_letter('K', &p, SK_ColorBLACK, Z, Z, canvas);
81 draw_center_letter('R', &p, SK_ColorRED, Z, D, canvas); 81 draw_center_letter('R', &p, SK_ColorRED, Z, D, canvas);
82 draw_center_letter('G', &p, SK_ColorGREEN, -X, -Y, canvas); 82 draw_center_letter('G', &p, SK_ColorGREEN, -X, -Y, canvas);
83 draw_center_letter('B', &p, SK_ColorBLUE, X, -Y, canvas); 83 draw_center_letter('B', &p, SK_ColorBLUE, X, -Y, canvas);
84 draw_center_letter('C', &p, SK_ColorCYAN, Z, -D, canvas); 84 draw_center_letter('C', &p, SK_ColorCYAN, Z, -D, canvas);
85 draw_center_letter('M', &p, SK_ColorMAGENTA, X, Y, canvas); 85 draw_center_letter('M', &p, SK_ColorMAGENTA, X, Y, canvas);
86 draw_center_letter('Y', &p, SK_ColorYELLOW, -X, Y, canvas); 86 draw_center_letter('Y', &p, SK_ColorYELLOW, -X, Y, canvas);
87 } 87 }
88 88
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 SkASSERT(notN32bitmap.colorType() == ct); 209 SkASSERT(notN32bitmap.colorType() == ct);
210 return SkImage::MakeFromBitmap(notN32bitmap); 210 return SkImage::MakeFromBitmap(notN32bitmap);
211 } 211 }
212 212
213 DEF_SIMPLE_GM(not_native32_bitmap_config, canvas, SCALE, SCALE) { 213 DEF_SIMPLE_GM(not_native32_bitmap_config, canvas, SCALE, SCALE) {
214 sk_sp<SkImage> notN32image(make_not_native32_color_wheel()); 214 sk_sp<SkImage> notN32image(make_not_native32_color_wheel());
215 SkASSERT(notN32image); 215 SkASSERT(notN32image);
216 sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8); 216 sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8);
217 canvas->drawImage(notN32image.get(), 0.0f, 0.0f); 217 canvas->drawImage(notN32image.get(), 0.0f, 0.0f);
218 } 218 }
OLDNEW
« no previous file with comments | « fuzz/FilterFuzz.cpp ('k') | gm/colortype.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698