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

Side by Side Diff: gm/drawbitmaprect.cpp

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 years, 4 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/downsamplebitmap.cpp ('k') | gm/drawlooper.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 2011 Google Inc. 3 * Copyright 2011 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SkRect::MakeWH(gSize * SK_Scalar1, 104 SkRect::MakeWH(gSize * SK_Scalar1,
105 gSize * SK_Scalar1), 105 gSize * SK_Scalar1),
106 &paint); 106 &paint);
107 canvas->translate(SK_Scalar1 * kPadX / 2, 107 canvas->translate(SK_Scalar1 * kPadX / 2,
108 SK_Scalar1 * kPadY / 2); 108 SK_Scalar1 * kPadY / 2);
109 SkPaint blackPaint; 109 SkPaint blackPaint;
110 SkScalar titleHeight = SK_Scalar1 * 24; 110 SkScalar titleHeight = SK_Scalar1 * 24;
111 blackPaint.setColor(SK_ColorBLACK); 111 blackPaint.setColor(SK_ColorBLACK);
112 blackPaint.setTextSize(titleHeight); 112 blackPaint.setTextSize(titleHeight);
113 blackPaint.setAntiAlias(true); 113 blackPaint.setAntiAlias(true);
114 sk_tool_utils::set_portable_typeface(&blackPaint);
114 SkString title; 115 SkString title;
115 title.printf("Bitmap size: %d x %d", kBmpSize, kBmpSize); 116 title.printf("Bitmap size: %d x %d", kBmpSize, kBmpSize);
116 canvas->drawText(title.c_str(), title.size(), 0, 117 canvas->drawText(title.c_str(), title.size(), 0,
117 titleHeight, blackPaint); 118 titleHeight, blackPaint);
118 119
119 canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight); 120 canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight);
120 int rowCount = 0; 121 int rowCount = 0;
121 canvas->save(); 122 canvas->save();
122 for (int w = 1; w <= kMaxSrcRectSize; w *= 4) { 123 for (int w = 1; w <= kMaxSrcRectSize; w *= 4) {
123 for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { 124 for (int h = 1; h <= kMaxSrcRectSize; h *= 4) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 177
177 private: 178 private:
178 typedef GM INHERITED; 179 typedef GM INHERITED;
179 }; 180 };
180 181
181 ////////////////////////////////////////////////////////////////////////////// 182 //////////////////////////////////////////////////////////////////////////////
182 183
183 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } 184 static GM* MyFactory(void*) { return new DrawBitmapRectGM; }
184 static GMRegistry reg(MyFactory); 185 static GMRegistry reg(MyFactory);
185 } 186 }
OLDNEW
« no previous file with comments | « gm/downsamplebitmap.cpp ('k') | gm/drawlooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698