OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |