| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 for (int i = 0; i < verbCnt; ++i) { | 102 for (int i = 0; i < verbCnt; ++i) { |
| 103 SkPath::Verb v = static_cast<SkPath::Verb>(pathCommands[i]); | 103 SkPath::Verb v = static_cast<SkPath::Verb>(pathCommands[i]); |
| 104 pathCommands[i] = verb_to_gl_path_cmd(v); | 104 pathCommands[i] = verb_to_gl_path_cmd(v); |
| 105 SkDEBUGCODE(numPts += num_pts(v)); | 105 SkDEBUGCODE(numPts += num_pts(v)); |
| 106 } | 106 } |
| 107 SkASSERT(pathPoints.count() == numPts); | 107 SkASSERT(pathPoints.count() == numPts); |
| 108 | 108 |
| 109 GR_GL_CALL(gpu->glInterface(), | 109 GR_GL_CALL(gpu->glInterface(), |
| 110 PathCommands(pathID, verbCnt, &pathCommands[0], | 110 PathCommands(pathID, verbCnt, &pathCommands[0], |
| 111 2 * pointCnt, GR_GL_FLOAT, &pathPoints[0])); | 111 2 * pointCnt, GR_GL_FLOAT, &pathPoints[0])); |
| 112 } else { |
| 113 GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, 0, NULL, 0, GR_GL_FL
OAT, NULL)); |
| 112 } | 114 } |
| 113 | 115 |
| 114 if (stroke.needToApply()) { | 116 if (stroke.needToApply()) { |
| 115 SkASSERT(!stroke.isHairlineStyle()); | 117 SkASSERT(!stroke.isHairlineStyle()); |
| 116 GR_GL_CALL(gpu->glInterface(), | 118 GR_GL_CALL(gpu->glInterface(), |
| 117 PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stro
ke.getWidth()))); | 119 PathParameterf(pathID, GR_GL_PATH_STROKE_WIDTH, SkScalarToFloat(stro
ke.getWidth()))); |
| 118 GR_GL_CALL(gpu->glInterface(), | 120 GR_GL_CALL(gpu->glInterface(), |
| 119 PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(strok
e.getMiter()))); | 121 PathParameterf(pathID, GR_GL_PATH_MITER_LIMIT, SkScalarToFloat(strok
e.getMiter()))); |
| 120 GrGLenum join = join_to_gl_join(stroke.getJoin()); | 122 GrGLenum join = join_to_gl_join(stroke.getJoin()); |
| 121 GR_GL_CALL(gpu->glInterface(), | 123 GR_GL_CALL(gpu->glInterface(), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 152 } | 154 } |
| 153 | 155 |
| 154 INHERITED::onRelease(); | 156 INHERITED::onRelease(); |
| 155 } | 157 } |
| 156 | 158 |
| 157 void GrGLPath::onAbandon() { | 159 void GrGLPath::onAbandon() { |
| 158 fPathID = 0; | 160 fPathID = 0; |
| 159 | 161 |
| 160 INHERITED::onAbandon(); | 162 INHERITED::onAbandon(); |
| 161 } | 163 } |
| OLD | NEW |