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

Side by Side Diff: gm/strokerect.cpp

Issue 1548643002: revised strokerect gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: handle halfway case in scan converter Created 5 years 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 | « gm/pathfill.cpp ('k') | include/core/SkRect.h » ('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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 static const SkRect gRects[] = { 72 static const SkRect gRects[] = {
73 { 0, 0, W, H }, 73 { 0, 0, W, H },
74 { W, 0, 0, H }, 74 { W, 0, 0, H },
75 { 0, H, W, 0 }, 75 { 0, H, W, 0 },
76 { 0, 0, STROKE_WIDTH, H }, 76 { 0, 0, STROKE_WIDTH, H },
77 { 0, 0, W, STROKE_WIDTH }, 77 { 0, 0, W, STROKE_WIDTH },
78 { 0, 0, STROKE_WIDTH/2, STROKE_WIDTH/2 }, 78 { 0, 0, STROKE_WIDTH/2, STROKE_WIDTH/2 },
79 { 0, 0, W, 0 }, 79 { 0, 0, W, 0 },
80 { 0, 0, 0, H }, 80 { 0, 0, 0, H },
81 { 0, 0, 0, 0 }, 81 { 0, 0, 0, 0 },
82 { 0, 0, W, FLT_EPSILON },
83 { 0, 0, FLT_EPSILON, H },
84 { 0, 0, FLT_EPSILON, FLT_EPSILON },
82 }; 85 };
83 86
84 for (int doFill = 0; doFill <= 1; ++doFill) { 87 for (int doFill = 0; doFill <= 1; ++doFill) {
85 for (size_t i = 0; i < SK_ARRAY_COUNT(gJoins); ++i) { 88 for (size_t i = 0; i < SK_ARRAY_COUNT(gJoins); ++i) {
86 SkPaint::Join join = gJoins[i]; 89 SkPaint::Join join = gJoins[i];
87 paint.setStrokeJoin(join); 90 paint.setStrokeJoin(join);
88 91
89 SkAutoCanvasRestore acr(canvas, true); 92 SkAutoCanvasRestore acr(canvas, true);
90 for (size_t j = 0; j < SK_ARRAY_COUNT(gRects); ++j) { 93 for (size_t j = 0; j < SK_ARRAY_COUNT(gRects); ++j) {
91 const SkRect& r = gRects[j]; 94 const SkRect& r = gRects[j];
(...skipping 12 matching lines...) Expand all
104 } 107 }
105 } 108 }
106 109
107 private: 110 private:
108 typedef GM INHERITED; 111 typedef GM INHERITED;
109 }; 112 };
110 113
111 //////////////////////////////////////////////////////////////////////////////// /////////////////// 114 //////////////////////////////////////////////////////////////////////////////// ///////////////////
112 115
113 DEF_GM(return new StrokeRectGM;) 116 DEF_GM(return new StrokeRectGM;)
OLDNEW
« no previous file with comments | « gm/pathfill.cpp ('k') | include/core/SkRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698