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(); |
139 } | 140 } |
140 | 141 |
141 GrGLPath::~GrGLPath() { | 142 GrGLPath::~GrGLPath() { |
142 this->release(); | 143 this->release(); |
143 } | 144 } |
144 | 145 |
145 void GrGLPath::onRelease() { | 146 void GrGLPath::onRelease() { |
146 if (0 != fPathID && !this->isWrapped()) { | 147 if (0 != fPathID && !this->isWrapped()) { |
147 static_cast<GrGpuGL*>(this->getGpu())->glPathRendering()->deletePaths(fP
athID, 1); | 148 static_cast<GrGpuGL*>(this->getGpu())->glPathRendering()->deletePaths(fP
athID, 1); |
148 fPathID = 0; | 149 fPathID = 0; |
149 } | 150 } |
150 | 151 |
151 INHERITED::onRelease(); | 152 INHERITED::onRelease(); |
152 } | 153 } |
153 | 154 |
154 void GrGLPath::onAbandon() { | 155 void GrGLPath::onAbandon() { |
155 fPathID = 0; | 156 fPathID = 0; |
156 | 157 |
157 INHERITED::onAbandon(); | 158 INHERITED::onAbandon(); |
158 } | 159 } |
OLD | NEW |