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 11 matching lines...) Expand all Loading... |
22 GrGLuint basePathID, | 22 GrGLuint basePathID, |
23 int numPaths, | 23 int numPaths, |
24 size_t gpuMemorySize, | 24 size_t gpuMemorySize, |
25 const SkStrokeRec& stroke) | 25 const SkStrokeRec& stroke) |
26 : INHERITED(gpu, numPaths, stroke), | 26 : INHERITED(gpu, numPaths, stroke), |
27 fBasePathID(basePathID), | 27 fBasePathID(basePathID), |
28 fGpuMemorySize(gpuMemorySize) { | 28 fGpuMemorySize(gpuMemorySize) { |
29 this->registerWithCache(); | 29 this->registerWithCache(); |
30 } | 30 } |
31 | 31 |
32 GrGLPathRange::~GrGLPathRange() { | |
33 this->release(); | |
34 } | |
35 | |
36 void GrGLPathRange::onInitPath(int index, const SkPath& skPath) const { | 32 void GrGLPathRange::onInitPath(int index, const SkPath& skPath) const { |
37 GrGpuGL* gpu = static_cast<GrGpuGL*>(this->getGpu()); | 33 GrGpuGL* gpu = static_cast<GrGpuGL*>(this->getGpu()); |
38 if (NULL == gpu) { | 34 if (NULL == gpu) { |
39 return; | 35 return; |
40 } | 36 } |
41 | 37 |
42 // Make sure the path at this index hasn't been initted already. | 38 // Make sure the path at this index hasn't been initted already. |
43 SkDEBUGCODE( | 39 SkDEBUGCODE( |
44 GrGLboolean isPath; | 40 GrGLboolean isPath; |
45 GR_GL_CALL_RET(gpu->glInterface(), isPath, IsPath(fBasePathID + index)))
; | 41 GR_GL_CALL_RET(gpu->glInterface(), isPath, IsPath(fBasePathID + index)))
; |
(...skipping 15 matching lines...) Expand all Loading... |
61 } | 57 } |
62 | 58 |
63 INHERITED::onRelease(); | 59 INHERITED::onRelease(); |
64 } | 60 } |
65 | 61 |
66 void GrGLPathRange::onAbandon() { | 62 void GrGLPathRange::onAbandon() { |
67 fBasePathID = 0; | 63 fBasePathID = 0; |
68 | 64 |
69 INHERITED::onAbandon(); | 65 INHERITED::onAbandon(); |
70 } | 66 } |
OLD | NEW |