| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, NULL, 0, GR_GL_FL
OAT, NULL)); | 113 GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, NULL, 0, GR_GL_FL
OAT, NULL)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 if (stroke.needToApply()) { | 116 if (stroke.needToApply()) { |
| 117 SkASSERT(!stroke.isHairlineStyle()); | 117 SkASSERT(!stroke.isHairlineStyle()); |
| 118 GR_GL_CALL(gpu->glInterface(), | 118 GR_GL_CALL(gpu->glInterface(), |
| 119 PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stro
ke.getWidth()))); | 119 PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stro
ke.getWidth()))); |
| 120 GR_GL_CALL(gpu->glInterface(), | 120 GR_GL_CALL(gpu->glInterface(), |
| 121 PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(strok
e.getMiter()))); | 121 PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(strok
e.getMiter()))); |
| 122 GrGLenum join = join_to_gl_join(stroke.getJoin()); | 122 GrGLenum join = join_to_gl_join(stroke.getJoin()); |
| 123 GR_GL_CALL(gpu->glInterface(), | 123 GR_GL_CALL(gpu->glInterface(), PathParameteri(pathID, GR_GL_PATH_JOIN_ST
YLE, join)); |
| 124 PathParameteri(pathID, GR_GL_PATH_JOIN_STYLE, join)); | |
| 125 GrGLenum cap = cap_to_gl_cap(stroke.getCap()); | 124 GrGLenum cap = cap_to_gl_cap(stroke.getCap()); |
| 126 GR_GL_CALL(gpu->glInterface(), | 125 GR_GL_CALL(gpu->glInterface(), PathParameteri(pathID, GR_GL_PATH_END_CAP
S, cap)); |
| 127 PathParameteri(pathID, GR_GL_PATH_INITIAL_END_CAP, cap)); | |
| 128 GR_GL_CALL(gpu->glInterface(), | |
| 129 PathParameteri(pathID, GR_GL_PATH_TERMINAL_END_CAP, cap)); | |
| 130 } | 126 } |
| 131 } | 127 } |
| 132 | 128 |
| 133 GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path, const SkStrokeRec& stroke) | 129 GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path, const SkStrokeRec& stroke) |
| 134 : INHERITED(gpu, kIsWrapped, path, stroke), | 130 : INHERITED(gpu, kIsWrapped, path, stroke), |
| 135 fPathID(gpu->glPathRendering()->genPaths(1)) { | 131 fPathID(gpu->glPathRendering()->genPaths(1)) { |
| 136 | 132 |
| 137 InitPathObject(gpu, fPathID, fSkPath, stroke); | 133 InitPathObject(gpu, fPathID, fSkPath, stroke); |
| 138 | 134 |
| 139 if (stroke.needToApply()) { | 135 if (stroke.needToApply()) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 150 } | 146 } |
| 151 | 147 |
| 152 INHERITED::onRelease(); | 148 INHERITED::onRelease(); |
| 153 } | 149 } |
| 154 | 150 |
| 155 void GrGLPath::onAbandon() { | 151 void GrGLPath::onAbandon() { |
| 156 fPathID = 0; | 152 fPathID = 0; |
| 157 | 153 |
| 158 INHERITED::onAbandon(); | 154 INHERITED::onAbandon(); |
| 159 } | 155 } |
| OLD | NEW |