| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 acr.restore(); | 103 acr.restore(); |
| 104 canvas->translate(0, H + 2 * STROKE_WIDTH); | 104 canvas->translate(0, H + 2 * STROKE_WIDTH); |
| 105 } | 105 } |
| 106 paint.setStyle(SkPaint::kStrokeAndFill_Style); | 106 paint.setStyle(SkPaint::kStrokeAndFill_Style); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 typedef GM INHERITED; | 111 typedef GM INHERITED; |
| 112 }; | 112 }; |
| 113 DEF_GM(return new StrokeRectGM;) |
| 113 | 114 |
| 114 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 115 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 115 | 116 |
| 116 DEF_GM(return new StrokeRectGM;) | 117 /* |
| 118 * Exercise rect-stroking (which is specialized from paths) when the resulting
stroke-width is |
| 119 * non-square. See https://bugs.chromium.org/p/skia/issues/detail?id=5408 |
| 120 */ |
| 121 DEF_SIMPLE_GM(strokerect_anisotropic_5408, canvas, 200, 50) { |
| 122 SkPaint p; |
| 123 p.setStyle(SkPaint::kStroke_Style); |
| 124 p.setStrokeWidth(6); |
| 125 |
| 126 canvas->scale(10, 1); |
| 127 SkRect r = SkRect::MakeXYWH(5, 20, 10, 10); |
| 128 canvas->drawRect(r, p); |
| 129 } |
| OLD | NEW |