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

Side by Side Diff: gm/shadertext.cpp

Issue 1184123002: Revert of make gm background colors 565 compatible (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/rrects.cpp ('k') | gm/shadertext2.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 static const GradMaker gGradMakers[] = { 81 static const GradMaker gGradMakers[] = {
82 MakeLinear, MakeRadial, MakeSweep, Make2Conical 82 MakeLinear, MakeRadial, MakeSweep, Make2Conical
83 }; 83 };
84 84
85 /////////////////////////////////////////////////////////////////////////////// 85 ///////////////////////////////////////////////////////////////////////////////
86 86
87 class ShaderTextGM : public GM { 87 class ShaderTextGM : public GM {
88 public: 88 public:
89 ShaderTextGM() { 89 ShaderTextGM() {
90 this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD)); 90 this->setBGColor(0xFFDDDDDD);
91 } 91 }
92 92
93 protected: 93 protected:
94 94
95 SkString onShortName() override { 95 SkString onShortName() override {
96 return SkString("shadertext"); 96 return SkString("shadertext");
97 } 97 }
98 98
99 SkISize onISize() override { return SkISize::Make(1450, 500); } 99 SkISize onISize() override { return SkISize::Make(1450, 500); }
100 100
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 makebm(&bm, w/16, h/4); 137 makebm(&bm, w/16, h/4);
138 for (size_t tx = 0; tx < SK_ARRAY_COUNT(tileModes); ++tx) { 138 for (size_t tx = 0; tx < SK_ARRAY_COUNT(tileModes); ++tx) {
139 for (size_t ty = 0; ty < SK_ARRAY_COUNT(tileModes); ++ty) { 139 for (size_t ty = 0; ty < SK_ARRAY_COUNT(tileModes); ++ty) {
140 shaders[shdIdx++] = SkShader::CreateBitmapShader(bm, tileModes[t x], tileModes[ty]); 140 shaders[shdIdx++] = SkShader::CreateBitmapShader(bm, tileModes[t x], tileModes[ty]);
141 } 141 }
142 } 142 }
143 143
144 SkPaint paint; 144 SkPaint paint;
145 paint.setDither(true); 145 paint.setDither(true);
146 paint.setAntiAlias(true); 146 paint.setAntiAlias(true);
147 sk_tool_utils::set_portable_typeface_always(&paint); 147 sk_tool_utils::set_portable_typeface(&paint);
148 paint.setTextSize(SkIntToScalar(pointSize)); 148 paint.setTextSize(SkIntToScalar(pointSize));
149 149
150 canvas->save(); 150 canvas->save();
151 canvas->translate(SkIntToScalar(20), SkIntToScalar(10)); 151 canvas->translate(SkIntToScalar(20), SkIntToScalar(10));
152 152
153 SkPath path; 153 SkPath path;
154 path.arcTo(SkRect::MakeXYWH(SkIntToScalar(-40), SkIntToScalar(15), 154 path.arcTo(SkRect::MakeXYWH(SkIntToScalar(-40), SkIntToScalar(15),
155 SkIntToScalar(300), SkIntToScalar(90)), 155 SkIntToScalar(300), SkIntToScalar(90)),
156 SkIntToScalar(225), SkIntToScalar(90), 156 SkIntToScalar(225), SkIntToScalar(90),
157 false); 157 false);
(...skipping 24 matching lines...) Expand all
182 182
183 private: 183 private:
184 typedef GM INHERITED; 184 typedef GM INHERITED;
185 }; 185 };
186 186
187 /////////////////////////////////////////////////////////////////////////////// 187 ///////////////////////////////////////////////////////////////////////////////
188 188
189 static GM* MyFactory(void*) { return new ShaderTextGM; } 189 static GM* MyFactory(void*) { return new ShaderTextGM; }
190 static GMRegistry reg(MyFactory); 190 static GMRegistry reg(MyFactory);
191 } 191 }
OLDNEW
« no previous file with comments | « gm/rrects.cpp ('k') | gm/shadertext2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698