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 #ifndef GrDebugGL_DEFINED | 9 #ifndef GrDebugGL_DEFINED |
10 #define GrDebugGL_DEFINED | 10 #define GrDebugGL_DEFINED |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 GrGLint getPackRowLength() const { return fPackRowLength; } | 84 GrGLint getPackRowLength() const { return fPackRowLength; } |
85 | 85 |
86 void setUnPackRowLength(GrGLint unPackRowLength) { | 86 void setUnPackRowLength(GrGLint unPackRowLength) { |
87 fUnPackRowLength = unPackRowLength; | 87 fUnPackRowLength = unPackRowLength; |
88 } | 88 } |
89 GrGLint getUnPackRowLength() const { return fUnPackRowLength; } | 89 GrGLint getUnPackRowLength() const { return fUnPackRowLength; } |
90 | 90 |
91 static GrDebugGL *getInstance() { | 91 static GrDebugGL *getInstance() { |
92 // someone should admit to actually using this class | 92 // someone should admit to actually using this class |
93 GrAssert(0 < gStaticRefCount); | 93 SkASSERT(0 < gStaticRefCount); |
94 | 94 |
95 if (NULL == gObj) { | 95 if (NULL == gObj) { |
96 gObj = SkNEW(GrDebugGL); | 96 gObj = SkNEW(GrDebugGL); |
97 } | 97 } |
98 | 98 |
99 return gObj; | 99 return gObj; |
100 } | 100 } |
101 | 101 |
102 void report() const; | 102 void report() const; |
103 | 103 |
104 static void staticRef() { | 104 static void staticRef() { |
105 gStaticRefCount++; | 105 gStaticRefCount++; |
106 } | 106 } |
107 | 107 |
108 static void staticUnRef() { | 108 static void staticUnRef() { |
109 GrAssert(gStaticRefCount > 0); | 109 SkASSERT(gStaticRefCount > 0); |
110 gStaticRefCount--; | 110 gStaticRefCount--; |
111 if (0 == gStaticRefCount) { | 111 if (0 == gStaticRefCount) { |
112 SkDELETE(gObj); | 112 SkDELETE(gObj); |
113 gObj = NULL; | 113 gObj = NULL; |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 protected: | 117 protected: |
118 | 118 |
119 private: | 119 private: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // type) easier | 151 // type) easier |
152 #define GR_CREATE(className, classEnum) \ | 152 #define GR_CREATE(className, classEnum) \ |
153 reinterpret_cast<className *>(GrDebugGL::getInstance()->createObj(classEnum)
) | 153 reinterpret_cast<className *>(GrDebugGL::getInstance()->createObj(classEnum)
) |
154 | 154 |
155 //////////////////////////////////////////////////////////////////////////////// | 155 //////////////////////////////////////////////////////////////////////////////// |
156 // Helper macro to make finding objects less painful | 156 // Helper macro to make finding objects less painful |
157 #define GR_FIND(id, className, classEnum) \ | 157 #define GR_FIND(id, className, classEnum) \ |
158 reinterpret_cast<className *>(GrDebugGL::getInstance()->findObject(id, class
Enum)) | 158 reinterpret_cast<className *>(GrDebugGL::getInstance()->findObject(id, class
Enum)) |
159 | 159 |
160 #endif // GrDebugGL_DEFINED | 160 #endif // GrDebugGL_DEFINED |
OLD | NEW |