OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 "GrGLPathRange.h" | 9 #include "GrGLPathRange.h" |
10 #include "GrGLPath.h" | 10 #include "GrGLPath.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 GrGLPath::InitPathObject(gpu, fBasePathID + index, *skPath, *stroke); | 83 GrGLPath::InitPathObject(gpu, fBasePathID + index, *skPath, *stroke); |
84 | 84 |
85 // TODO: Use a better approximation for the individual path sizes. | 85 // TODO: Use a better approximation for the individual path sizes. |
86 fGpuMemorySize += 100; | 86 fGpuMemorySize += 100; |
87 } | 87 } |
88 | 88 |
89 void GrGLPathRange::onRelease() { | 89 void GrGLPathRange::onRelease() { |
90 SkASSERT(this->getGpu()); | 90 SkASSERT(this->getGpu()); |
91 | 91 |
92 if (0 != fBasePathID && !this->isWrapped()) { | 92 if (0 != fBasePathID && this->shouldFreeResources()) { |
93 static_cast<GrGLGpu*>(this->getGpu())->glPathRendering()->deletePaths(fB
asePathID, | 93 static_cast<GrGLGpu*>(this->getGpu())->glPathRendering()->deletePaths(fB
asePathID, |
94 th
is->getNumPaths()); | 94 th
is->getNumPaths()); |
95 fBasePathID = 0; | 95 fBasePathID = 0; |
96 } | 96 } |
97 | 97 |
98 INHERITED::onRelease(); | 98 INHERITED::onRelease(); |
99 } | 99 } |
100 | 100 |
101 void GrGLPathRange::onAbandon() { | 101 void GrGLPathRange::onAbandon() { |
102 fBasePathID = 0; | 102 fBasePathID = 0; |
103 | 103 |
104 INHERITED::onAbandon(); | 104 INHERITED::onAbandon(); |
105 } | 105 } |
OLD | NEW |