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

Side by Side Diff: gm/strokerect.cpp

Issue 2060543002: fix non-square stroke rects (non-aa) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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/SkScan_Hairline.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 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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkScan_Hairline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698