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

Side by Side Diff: gm/path_stroke_with_zero_length.cpp

Issue 1862113004: path_stroke_with_zero_length: turn off drawFat() by default. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 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 | tools/dm_flags.json » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkPath.h" 8 #include "SkPath.h"
9 #include "SkStream.h" 9 #include "SkStream.h"
10 #include "gm.h" 10 #include "gm.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 bkgrnd.setColor(SK_ColorWHITE); 84 bkgrnd.setColor(SK_ColorWHITE);
85 canvas->drawRect(SkRect::MakeIWH(onISize().fWidth, onISize().fHeight), b kgrnd); 85 canvas->drawRect(SkRect::MakeIWH(onISize().fWidth, onISize().fHeight), b kgrnd);
86 86
87 auto drawPaths = [&](SkPaint& paint, int indexMask) { 87 auto drawPaths = [&](SkPaint& paint, int indexMask) {
88 canvas->translate(0, 30.0f); 88 canvas->translate(0, 30.0f);
89 int index = 0; 89 int index = 0;
90 for (const SkPath& path : fPaths) { 90 for (const SkPath& path : fPaths) {
91 if (indexMask & (1 << index)) { 91 if (indexMask & (1 << index)) {
92 canvas->drawPath(path, paint); 92 canvas->drawPath(path, paint);
93 } 93 }
94 if (paint.getStrokeWidth() < 2) { 94 if (this->getMode() == skiagm::GM::kSample_Mode && paint.getStro keWidth() < 2) {
95 drawFat(canvas, path, paint, index); 95 drawFat(canvas, path, paint, index);
96 } 96 }
97 ++index; 97 ++index;
98 } 98 }
99 }; 99 };
100 100
101 if (false) { // debugging variant that draws a single element 101 if (false) { // debugging variant that draws a single element
102 SkScalar width = 0; 102 SkScalar width = 0;
103 bool antialias = true; 103 bool antialias = true;
104 104
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 + (index >= 5 ? 5 : 0)) / scale, (bounds.fTop - 20 + 420) / scale); 186 + (index >= 5 ? 5 : 0)) / scale, (bounds.fTop - 20 + 420) / scale);
187 canvas->restore(); 187 canvas->restore();
188 } 188 }
189 } 189 }
190 190
191 }; 191 };
192 192
193 /////////////////////////////////////////////////////////////////////////////// 193 ///////////////////////////////////////////////////////////////////////////////
194 194
195 DEF_GM( return new StrokeZeroGM(); ) 195 DEF_GM( return new StrokeZeroGM(); )
OLDNEW
« no previous file with comments | « no previous file | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698