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

Side by Side Diff: gm/tilemodes_scaled.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/tilemodes.cpp ('k') | no next file » | 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 ScaledTiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { 192 ScaledTiling2GM(ShaderProc proc, const char name[]) : fProc(proc) {
193 fName.printf("scaled_tilemode_%s", name); 193 fName.printf("scaled_tilemode_%s", name);
194 } 194 }
195 195
196 protected: 196 protected:
197 197
198 SkString onShortName() override { 198 SkString onShortName() override {
199 return fName; 199 return fName;
200 } 200 }
201 201
202 SkISize onISize() override { return SkISize::Make(880, 560); } 202 SkISize onISize() override { return SkISize::Make(650, 610); }
203 203
204 void onDraw(SkCanvas* canvas) override { 204 void onDraw(SkCanvas* canvas) override {
205 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); 205 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2);
206 206
207 const SkScalar w = SkIntToScalar(gWidth); 207 const SkScalar w = SkIntToScalar(gWidth);
208 const SkScalar h = SkIntToScalar(gHeight); 208 const SkScalar h = SkIntToScalar(gHeight);
209 SkRect r = { -w, -h, w*2, h*2 }; 209 SkRect r = { -w, -h, w*2, h*2 };
210 210
211 static const SkShader::TileMode gModes[] = { 211 static const SkShader::TileMode gModes[] = {
212 SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMi rror_TileMode 212 SkShader::kClamp_TileMode, SkShader::kRepeat_TileMode, SkShader::kMi rror_TileMode
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 private: 257 private:
258 typedef skiagm::GM INHERITED; 258 typedef skiagm::GM INHERITED;
259 }; 259 };
260 260
261 ////////////////////////////////////////////////////////////////////////////// 261 //////////////////////////////////////////////////////////////////////////////
262 262
263 DEF_GM( return new ScaledTilingGM(true); ) 263 DEF_GM( return new ScaledTilingGM(true); )
264 DEF_GM( return new ScaledTilingGM(false); ) 264 DEF_GM( return new ScaledTilingGM(false); )
265 DEF_GM( return new ScaledTiling2GM(make_bm, "bitmap"); ) 265 DEF_GM( return new ScaledTiling2GM(make_bm, "bitmap"); )
266 DEF_GM( return new ScaledTiling2GM(make_grad, "gradient"); ) 266 DEF_GM( return new ScaledTiling2GM(make_grad, "gradient"); )
OLDNEW
« no previous file with comments | « gm/tilemodes.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698