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

Side by Side Diff: gm/tilemodes.cpp

Issue 1876753003: adjust gm bounds for better content fit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/textblobmixedsizes.cpp ('k') | gm/tilemodes_scaled.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 #include "gm.h" 7 #include "gm.h"
8 #include "SkPath.h" 8 #include "SkPath.h"
9 #include "SkRegion.h" 9 #include "SkRegion.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { 187 Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) {
188 fName.printf("tilemode_%s", name); 188 fName.printf("tilemode_%s", name);
189 } 189 }
190 190
191 protected: 191 protected:
192 192
193 SkString onShortName() override { 193 SkString onShortName() override {
194 return fName; 194 return fName;
195 } 195 }
196 196
197 SkISize onISize() override { return SkISize::Make(880, 560); } 197 SkISize onISize() override { return SkISize::Make(650, 610); }
198 198
199 void onDraw(SkCanvas* canvas) override { 199 void onDraw(SkCanvas* canvas) override {
200 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); 200 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2);
201 201
202 const SkScalar w = SkIntToScalar(gWidth); 202 const SkScalar w = SkIntToScalar(gWidth);
203 const SkScalar h = SkIntToScalar(gHeight); 203 const SkScalar h = SkIntToScalar(gHeight);
204 SkRect r = { -w, -h, w*2, h*2 }; 204 SkRect r = { -w, -h, w*2, h*2 };
205 205
206 static const SkShader::TileMode gModes[] = { 206 static const SkShader::TileMode gModes[] = {
207 SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMi rror_TileMode 207 SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMi rror_TileMode
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 private: 252 private:
253 typedef skiagm::GM INHERITED; 253 typedef skiagm::GM INHERITED;
254 }; 254 };
255 255
256 ////////////////////////////////////////////////////////////////////////////// 256 //////////////////////////////////////////////////////////////////////////////
257 257
258 DEF_GM( return new TilingGM(true); ) 258 DEF_GM( return new TilingGM(true); )
259 DEF_GM( return new TilingGM(false); ) 259 DEF_GM( return new TilingGM(false); )
260 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) 260 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); )
261 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) 261 DEF_GM( return new Tiling2GM(make_grad, "gradient"); )
OLDNEW
« no previous file with comments | « gm/textblobmixedsizes.cpp ('k') | gm/tilemodes_scaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698