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

Side by Side Diff: gm/gm.cpp

Issue 1257773002: rename portable_typeface_always to portable_typeface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unncessary change to path test Created 5 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 | « no previous file | gm/imageblur2.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 2011 Google Inc. 2 * Copyright 2011 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 "gm.h" 8 #include "gm.h"
9 #include "SkShader.h" 9 #include "SkShader.h"
10 using namespace skiagm; 10 using namespace skiagm;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 void GM::drawGpuOnlyMessage(SkCanvas* canvas) { 73 void GM::drawGpuOnlyMessage(SkCanvas* canvas) {
74 SkBitmap bmp; 74 SkBitmap bmp;
75 bmp.allocN32Pixels(128, 64); 75 bmp.allocN32Pixels(128, 64);
76 SkCanvas bmpCanvas(bmp); 76 SkCanvas bmpCanvas(bmp);
77 bmpCanvas.drawColor(SK_ColorWHITE); 77 bmpCanvas.drawColor(SK_ColorWHITE);
78 SkPaint paint; 78 SkPaint paint;
79 paint.setAntiAlias(true); 79 paint.setAntiAlias(true);
80 paint.setTextSize(20); 80 paint.setTextSize(20);
81 paint.setColor(SK_ColorRED); 81 paint.setColor(SK_ColorRED);
82 sk_tool_utils::set_portable_typeface(&paint);
82 static const char kTxt[] = "GPU Only"; 83 static const char kTxt[] = "GPU Only";
83 bmpCanvas.drawText(kTxt, strlen(kTxt), 20, 40, paint); 84 bmpCanvas.drawText(kTxt, strlen(kTxt), 20, 40, paint);
84 SkMatrix localM; 85 SkMatrix localM;
85 localM.setRotate(35.f); 86 localM.setRotate(35.f);
86 localM.postTranslate(10.f, 0.f); 87 localM.postTranslate(10.f, 0.f);
87 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp, SkShader::kM irror_TileMode, 88 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp, SkShader::kM irror_TileMode,
88 SkShader::kMirror _TileMode, 89 SkShader::kMirror _TileMode,
89 &localM)); 90 &localM));
90 paint.setShader(shader); 91 paint.setShader(shader);
91 paint.setFilterQuality(kMedium_SkFilterQuality); 92 paint.setFilterQuality(kMedium_SkFilterQuality);
92 canvas->drawPaint(paint); 93 canvas->drawPaint(paint);
93 return; 94 return;
94 } 95 }
95 96
96 // need to explicitly declare this, or we get some weird infinite loop llist 97 // need to explicitly declare this, or we get some weird infinite loop llist
97 template GMRegistry* GMRegistry::gHead; 98 template GMRegistry* GMRegistry::gHead;
98 99
99 void skiagm::SimpleGM::onDraw(SkCanvas* canvas) { 100 void skiagm::SimpleGM::onDraw(SkCanvas* canvas) {
100 fDrawProc(canvas); 101 fDrawProc(canvas);
101 } 102 }
102 103
103 SkISize skiagm::SimpleGM::onISize() { 104 SkISize skiagm::SimpleGM::onISize() {
104 return fSize; 105 return fSize;
105 } 106 }
106 107
107 SkString skiagm::SimpleGM::onShortName() { 108 SkString skiagm::SimpleGM::onShortName() {
108 return fName; 109 return fName;
109 } 110 }
110 111
OLDNEW
« no previous file with comments | « no previous file | gm/imageblur2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698