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

Side by Side Diff: gm/showmiplevels.cpp

Issue 1714363002: SkNx: kth<...>() -> [...] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: the rest Created 4 years, 10 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 | src/core/SkColor.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 2016 Google Inc. 2 * Copyright 2016 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 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 SkCanvas canvas(bm); 59 SkCanvas canvas(bm);
60 canvas.clear(0xFFFFFFFF); 60 canvas.clear(0xFFFFFFFF);
61 SkPaint paint; 61 SkPaint paint;
62 paint.setStyle(SkPaint::kStroke_Style); 62 paint.setStyle(SkPaint::kStroke_Style);
63 paint.setStrokeWidth(2.1f); 63 paint.setStrokeWidth(2.1f);
64 paint.setColor(SHOW_MIP_COLOR); 64 paint.setColor(SHOW_MIP_COLOR);
65 65
66 SkScalar s = SkIntToScalar(w); 66 SkScalar s = SkIntToScalar(w);
67 Sk4f p(s, -s, -s, s); 67 Sk4f p(s, -s, -s, s);
68 Sk4f d(5); 68 Sk4f d(5);
69 while (p.kth<1>() < s) { 69 while (p[1] < s) {
70 canvas.drawLine(p.kth<0>(),p.kth<1>(), p.kth<2>(), p.kth<3>(), paint); 70 canvas.drawLine(p[0],p[1], p[2], p[3], paint);
71 p = p + d; 71 p = p + d;
72 } 72 }
73 return bm; 73 return bm;
74 } 74 }
75 75
76 class ShowMipLevels : public skiagm::GM { 76 class ShowMipLevels : public skiagm::GM {
77 const int fN; 77 const int fN;
78 SkBitmap fBM[4]; 78 SkBitmap fBM[4];
79 79
80 public: 80 public:
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 } 303 }
304 304
305 private: 305 private:
306 typedef skiagm::GM INHERITED; 306 typedef skiagm::GM INHERITED;
307 }; 307 };
308 DEF_GM( return new ShowMipLevels2(255, 255); ) 308 DEF_GM( return new ShowMipLevels2(255, 255); )
309 DEF_GM( return new ShowMipLevels2(256, 255); ) 309 DEF_GM( return new ShowMipLevels2(256, 255); )
310 DEF_GM( return new ShowMipLevels2(255, 256); ) 310 DEF_GM( return new ShowMipLevels2(255, 256); )
311 DEF_GM( return new ShowMipLevels2(256, 256); ) 311 DEF_GM( return new ShowMipLevels2(256, 256); )
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698