| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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); ) |
| OLD | NEW |