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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 : INHERITED(gpu, kIsWrapped, path, stroke), | 129 : INHERITED(gpu, kIsWrapped, path, stroke), |
130 fPathID(gpu->glPathRendering()->genPaths(1)) { | 130 fPathID(gpu->glPathRendering()->genPaths(1)) { |
131 SkASSERT(!path.isEmpty()); | 131 SkASSERT(!path.isEmpty()); |
132 | 132 |
133 InitPathObject(gpu, fPathID, fSkPath, stroke); | 133 InitPathObject(gpu, fPathID, fSkPath, stroke); |
134 | 134 |
135 if (stroke.needToApply()) { | 135 if (stroke.needToApply()) { |
136 // FIXME: try to account for stroking, without rasterizing the stroke. | 136 // FIXME: try to account for stroking, without rasterizing the stroke. |
137 fBounds.outset(stroke.getWidth(), stroke.getWidth()); | 137 fBounds.outset(stroke.getWidth(), stroke.getWidth()); |
138 } | 138 } |
139 this->registerWithCache(); | |
140 } | 139 } |
141 | 140 |
142 GrGLPath::~GrGLPath() { | 141 GrGLPath::~GrGLPath() { |
143 this->release(); | 142 this->release(); |
144 } | 143 } |
145 | 144 |
146 void GrGLPath::onRelease() { | 145 void GrGLPath::onRelease() { |
147 if (0 != fPathID && !this->isWrapped()) { | 146 if (0 != fPathID && !this->isWrapped()) { |
148 static_cast<GrGpuGL*>(this->getGpu())->glPathRendering()->deletePaths(fP
athID, 1); | 147 static_cast<GrGpuGL*>(this->getGpu())->glPathRendering()->deletePaths(fP
athID, 1); |
149 fPathID = 0; | 148 fPathID = 0; |
150 } | 149 } |
151 | 150 |
152 INHERITED::onRelease(); | 151 INHERITED::onRelease(); |
153 } | 152 } |
154 | 153 |
155 void GrGLPath::onAbandon() { | 154 void GrGLPath::onAbandon() { |
156 fPathID = 0; | 155 fPathID = 0; |
157 | 156 |
158 INHERITED::onAbandon(); | 157 INHERITED::onAbandon(); |
159 } | 158 } |
OLD | NEW |