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

Side by Side Diff: gm/xfermodes.cpp

Issue 1790353002: Revert of more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/verylargebitmap.cpp ('k') | gm/xfermodes2.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 return SkISize::Make(1990, 660); 254 return SkISize::Make(1990, 660);
255 } 255 }
256 256
257 void onDraw(SkCanvas* canvas) override { 257 void onDraw(SkCanvas* canvas) override {
258 canvas->translate(SkIntToScalar(10), SkIntToScalar(20)); 258 canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
259 259
260 const SkScalar w = SkIntToScalar(W); 260 const SkScalar w = SkIntToScalar(W);
261 const SkScalar h = SkIntToScalar(H); 261 const SkScalar h = SkIntToScalar(H);
262 SkMatrix m; 262 SkMatrix m;
263 m.setScale(SkIntToScalar(6), SkIntToScalar(6)); 263 m.setScale(SkIntToScalar(6), SkIntToScalar(6));
264 auto s = SkShader::MakeBitmapShader(fBG, SkShader::kRepeat_TileMode, 264 SkShader* s = SkShader::CreateBitmapShader(fBG,
265 SkShader::kRepeat_TileMode, &m); 265 SkShader::kRepeat_TileMode,
266 SkShader::kRepeat_TileMode,
267 &m);
266 268
267 SkPaint labelP; 269 SkPaint labelP;
268 labelP.setAntiAlias(true); 270 labelP.setAntiAlias(true);
269 sk_tool_utils::set_portable_typeface(&labelP); 271 sk_tool_utils::set_portable_typeface(&labelP);
270 labelP.setTextAlign(SkPaint::kCenter_Align); 272 labelP.setTextAlign(SkPaint::kCenter_Align);
271 273
272 const int W = 5; 274 const int W = 5;
273 275
274 SkScalar x0 = 0; 276 SkScalar x0 = 0;
275 SkScalar y0 = 0; 277 SkScalar y0 = 0;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 if (y < 320) { 318 if (y < 320) {
317 if (x > x0) { 319 if (x > x0) {
318 y += h + SkIntToScalar(30); 320 y += h + SkIntToScalar(30);
319 } 321 }
320 y0 = y; 322 y0 = y;
321 } else { 323 } else {
322 x0 += SkIntToScalar(400); 324 x0 += SkIntToScalar(400);
323 y0 = 0; 325 y0 = 0;
324 } 326 }
325 } 327 }
328 s->unref();
326 } 329 }
327 330
328 private: 331 private:
329 typedef GM INHERITED; 332 typedef GM INHERITED;
330 }; 333 };
331 DEF_GM( return new XfermodesGM; ) 334 DEF_GM( return new XfermodesGM; )
OLDNEW
« no previous file with comments | « gm/verylargebitmap.cpp ('k') | gm/xfermodes2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698