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

Side by Side Diff: src/gpu/gl/GrGLPath.cpp

Issue 1124423007: Improve NVPR stroke accuracy to fix thick strokes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « src/gpu/gl/GrGLDefines.h ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrGLPath.h" 9 #include "GrGLPath.h"
10 #include "GrGLPathRendering.h" 10 #include "GrGLPathRendering.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (stroke.needToApply()) { 171 if (stroke.needToApply()) {
172 SkASSERT(!stroke.isHairlineStyle()); 172 SkASSERT(!stroke.isHairlineStyle());
173 GR_GL_CALL(gpu->glInterface(), 173 GR_GL_CALL(gpu->glInterface(),
174 PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stro ke.getWidth()))); 174 PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stro ke.getWidth())));
175 GR_GL_CALL(gpu->glInterface(), 175 GR_GL_CALL(gpu->glInterface(),
176 PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(strok e.getMiter()))); 176 PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(strok e.getMiter())));
177 GrGLenum join = join_to_gl_join(stroke.getJoin()); 177 GrGLenum join = join_to_gl_join(stroke.getJoin());
178 GR_GL_CALL(gpu->glInterface(), PathParameteri(pathID, GR_GL_PATH_JOIN_ST YLE, join)); 178 GR_GL_CALL(gpu->glInterface(), PathParameteri(pathID, GR_GL_PATH_JOIN_ST YLE, join));
179 GrGLenum cap = cap_to_gl_cap(stroke.getCap()); 179 GrGLenum cap = cap_to_gl_cap(stroke.getCap());
180 GR_GL_CALL(gpu->glInterface(), PathParameteri(pathID, GR_GL_PATH_END_CAP S, cap)); 180 GR_GL_CALL(gpu->glInterface(), PathParameteri(pathID, GR_GL_PATH_END_CAP S, cap));
181 GR_GL_CALL(gpu->glInterface(), PathParameterf(pathID, GR_GL_PATH_STROKE_ BOUND, 0.02f));
181 } 182 }
182 } 183 }
183 184
184 GrGLPath::GrGLPath(GrGLGpu* gpu, const SkPath& path, const SkStrokeRec& stroke) 185 GrGLPath::GrGLPath(GrGLGpu* gpu, const SkPath& path, const SkStrokeRec& stroke)
185 : INHERITED(gpu, path, stroke), 186 : INHERITED(gpu, path, stroke),
186 fPathID(gpu->glPathRendering()->genPaths(1)) { 187 fPathID(gpu->glPathRendering()->genPaths(1)) {
187 188
188 InitPathObject(gpu, fPathID, fSkPath, stroke); 189 InitPathObject(gpu, fPathID, fSkPath, stroke);
189 190
190 if (stroke.needToApply()) { 191 if (stroke.needToApply()) {
(...skipping 10 matching lines...) Expand all
201 } 202 }
202 203
203 INHERITED::onRelease(); 204 INHERITED::onRelease();
204 } 205 }
205 206
206 void GrGLPath::onAbandon() { 207 void GrGLPath::onAbandon() {
207 fPathID = 0; 208 fPathID = 0;
208 209
209 INHERITED::onAbandon(); 210 INHERITED::onAbandon();
210 } 211 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698