Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 17 | #ifndef ANDROID_HWUI_CACHES_H |
| 18 | #define ANDROID_HWUI_CACHES_H |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 19 | |
Romain Guy | a2341a9 | 2010-09-08 18:04:33 -0700 | [diff] [blame] | 20 | #ifndef LOG_TAG |
| 21 | #define LOG_TAG "OpenGLRenderer" |
| 22 | #endif |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 23 | |
| 24 | #include <utils/Singleton.h> |
| 25 | |
Romain Guy | 7953745 | 2011-10-12 13:48:51 -0700 | [diff] [blame] | 26 | #include <cutils/compiler.h> |
| 27 | |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 28 | #include "FontRenderer.h" |
| 29 | #include "GammaFontRenderer.h" |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 30 | #include "TextureCache.h" |
| 31 | #include "LayerCache.h" |
Romain Guy | 8d4aeb7 | 2013-02-12 16:08:55 -0800 | [diff] [blame^] | 32 | #include "RenderBufferCache.h" |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 33 | #include "GradientCache.h" |
| 34 | #include "PatchCache.h" |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 35 | #include "ProgramCache.h" |
Romain Guy | 01d58e4 | 2011-01-19 21:54:02 -0800 | [diff] [blame] | 36 | #include "ShapeCache.h" |
Romain Guy | ff26a0c | 2011-01-20 11:35:46 -0800 | [diff] [blame] | 37 | #include "PathCache.h" |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 38 | #include "TextDropShadowCache.h" |
Romain Guy | e2d345e | 2010-09-24 18:39:22 -0700 | [diff] [blame] | 39 | #include "FboCache.h" |
Chet Haase | 5c13d89 | 2010-10-08 08:37:55 -0700 | [diff] [blame] | 40 | #include "ResourceCache.h" |
Romain Guy | 0baaac5 | 2012-08-31 20:31:01 -0700 | [diff] [blame] | 41 | #include "Stencil.h" |
Romain Guy | 211efea | 2012-07-31 21:16:07 -0700 | [diff] [blame] | 42 | #include "Dither.h" |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 43 | |
| 44 | namespace android { |
| 45 | namespace uirenderer { |
| 46 | |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 47 | /////////////////////////////////////////////////////////////////////////////// |
| 48 | // Globals |
| 49 | /////////////////////////////////////////////////////////////////////////////// |
| 50 | |
| 51 | #define REQUIRED_TEXTURE_UNITS_COUNT 3 |
| 52 | |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 53 | #define REGION_MESH_QUAD_COUNT 512 |
| 54 | |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 55 | // Generates simple and textured vertices |
| 56 | #define FV(x, y, u, v) { { x, y }, { u, v } } |
| 57 | |
| 58 | // This array is never used directly but used as a memcpy source in the |
| 59 | // OpenGLRenderer constructor |
| 60 | static const TextureVertex gMeshVertices[] = { |
| 61 | FV(0.0f, 0.0f, 0.0f, 0.0f), |
| 62 | FV(1.0f, 0.0f, 1.0f, 0.0f), |
| 63 | FV(0.0f, 1.0f, 0.0f, 1.0f), |
| 64 | FV(1.0f, 1.0f, 1.0f, 1.0f) |
| 65 | }; |
| 66 | static const GLsizei gMeshStride = sizeof(TextureVertex); |
Chet Haase | 5b0200b | 2011-04-13 17:58:08 -0700 | [diff] [blame] | 67 | static const GLsizei gVertexStride = sizeof(Vertex); |
| 68 | static const GLsizei gAlphaVertexStride = sizeof(AlphaVertex); |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 69 | static const GLsizei gMeshTextureOffset = 2 * sizeof(float); |
Chris Craik | 6ebdc11 | 2012-08-31 18:24:33 -0700 | [diff] [blame] | 70 | static const GLsizei gVertexAlphaOffset = 2 * sizeof(float); |
Chet Haase | 99585ad | 2011-05-02 15:00:16 -0700 | [diff] [blame] | 71 | static const GLsizei gVertexAAWidthOffset = 2 * sizeof(float); |
| 72 | static const GLsizei gVertexAALengthOffset = 3 * sizeof(float); |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 73 | static const GLsizei gMeshCount = 4; |
| 74 | |
Romain Guy | a1d3c91 | 2011-12-13 14:55:06 -0800 | [diff] [blame] | 75 | static const GLenum gTextureUnits[] = { |
| 76 | GL_TEXTURE0, |
| 77 | GL_TEXTURE1, |
| 78 | GL_TEXTURE2 |
| 79 | }; |
| 80 | |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 81 | /////////////////////////////////////////////////////////////////////////////// |
| 82 | // Debug |
| 83 | /////////////////////////////////////////////////////////////////////////////// |
| 84 | |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 85 | struct CacheLogger { |
| 86 | CacheLogger() { |
Romain Guy | d6b2a00 | 2011-06-17 17:45:59 -0700 | [diff] [blame] | 87 | INIT_LOGD("Creating OpenGL renderer caches"); |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 88 | } |
| 89 | }; // struct CacheLogger |
| 90 | |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 91 | /////////////////////////////////////////////////////////////////////////////// |
| 92 | // Caches |
| 93 | /////////////////////////////////////////////////////////////////////////////// |
| 94 | |
Romain Guy | bb0acdf | 2012-03-05 13:44:35 -0800 | [diff] [blame] | 95 | class DisplayList; |
| 96 | |
Romain Guy | 7953745 | 2011-10-12 13:48:51 -0700 | [diff] [blame] | 97 | class ANDROID_API Caches: public Singleton<Caches> { |
Chet Haase | dd78cca | 2010-10-22 18:59:26 -0700 | [diff] [blame] | 98 | Caches(); |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 99 | |
| 100 | friend class Singleton<Caches>; |
| 101 | |
Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 102 | CacheLogger mLogger; |
Romain Guy | 9bca479 | 2010-10-25 18:42:25 -0700 | [diff] [blame] | 103 | |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 104 | public: |
Romain Guy | bdf7609 | 2011-07-18 15:00:43 -0700 | [diff] [blame] | 105 | enum FlushMode { |
Romain Guy | 6d7475d | 2011-07-27 16:28:21 -0700 | [diff] [blame] | 106 | kFlushMode_Layers = 0, |
| 107 | kFlushMode_Moderate, |
Romain Guy | bdf7609 | 2011-07-18 15:00:43 -0700 | [diff] [blame] | 108 | kFlushMode_Full |
| 109 | }; |
| 110 | |
| 111 | /** |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 112 | * Initialize caches. |
Romain Guy | 8ff6b9e | 2011-11-09 20:10:18 -0800 | [diff] [blame] | 113 | */ |
| 114 | void init(); |
| 115 | |
| 116 | /** |
Romain Guy | 5bb3c73 | 2012-11-29 17:52:58 -0800 | [diff] [blame] | 117 | * Initialize global system properties. |
| 118 | */ |
| 119 | bool initProperties(); |
| 120 | |
| 121 | /** |
Romain Guy | bdf7609 | 2011-07-18 15:00:43 -0700 | [diff] [blame] | 122 | * Flush the cache. |
| 123 | * |
| 124 | * @param mode Indicates how much of the cache should be flushed |
| 125 | */ |
| 126 | void flush(FlushMode mode); |
| 127 | |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 128 | /** |
Romain Guy | 8ff6b9e | 2011-11-09 20:10:18 -0800 | [diff] [blame] | 129 | * Destroys all resources associated with this cache. This should |
| 130 | * be called after a flush(kFlushMode_Full). |
| 131 | */ |
| 132 | void terminate(); |
| 133 | |
| 134 | /** |
Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 135 | * Indicates whether the renderer is in debug mode. |
| 136 | * This debug mode provides limited information to app developers. |
| 137 | */ |
| 138 | DebugLevel getDebugLevel() const { |
| 139 | return mDebugLevel; |
| 140 | } |
| 141 | |
| 142 | /** |
Romain Guy | fe48f65 | 2010-11-11 15:36:56 -0800 | [diff] [blame] | 143 | * Call this on each frame to ensure that garbage is deleted from |
| 144 | * GPU memory. |
| 145 | */ |
| 146 | void clearGarbage(); |
| 147 | |
| 148 | /** |
Romain Guy | ada830f | 2011-01-13 12:13:20 -0800 | [diff] [blame] | 149 | * Can be used to delete a layer from a non EGL thread. |
Romain Guy | 57066eb | 2011-01-12 12:53:32 -0800 | [diff] [blame] | 150 | */ |
Romain Guy | ada830f | 2011-01-13 12:13:20 -0800 | [diff] [blame] | 151 | void deleteLayerDeferred(Layer* layer); |
Romain Guy | 57066eb | 2011-01-12 12:53:32 -0800 | [diff] [blame] | 152 | |
Romain Guy | bb0acdf | 2012-03-05 13:44:35 -0800 | [diff] [blame] | 153 | /* |
| 154 | * Can be used to delete a display list from a non EGL thread. |
| 155 | */ |
| 156 | void deleteDisplayListDeferred(DisplayList* layer); |
| 157 | |
Romain Guy | 57066eb | 2011-01-12 12:53:32 -0800 | [diff] [blame] | 158 | /** |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 159 | * Binds the VBO used to render simple textured quads. |
| 160 | */ |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 161 | bool bindMeshBuffer(); |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 162 | |
| 163 | /** |
| 164 | * Binds the specified VBO if needed. |
| 165 | */ |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 166 | bool bindMeshBuffer(const GLuint buffer); |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 167 | |
| 168 | /** |
| 169 | * Unbinds the VBO used to render simple textured quads. |
| 170 | */ |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 171 | bool unbindMeshBuffer(); |
| 172 | |
Romain Guy | 15bc643 | 2011-12-13 13:11:32 -0800 | [diff] [blame] | 173 | bool bindIndicesBuffer(const GLuint buffer); |
| 174 | bool unbindIndicesBuffer(); |
| 175 | |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 176 | /** |
| 177 | * Binds an attrib to the specified float vertex pointer. |
| 178 | * Assumes a stride of gMeshStride and a size of 2. |
| 179 | */ |
Chris Craik | cb4d600 | 2012-09-25 12:00:29 -0700 | [diff] [blame] | 180 | void bindPositionVertexPointer(bool force, GLvoid* vertices, GLsizei stride = gMeshStride); |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 181 | |
| 182 | /** |
| 183 | * Binds an attrib to the specified float vertex pointer. |
| 184 | * Assumes a stride of gMeshStride and a size of 2. |
| 185 | */ |
Chris Craik | cb4d600 | 2012-09-25 12:00:29 -0700 | [diff] [blame] | 186 | void bindTexCoordsVertexPointer(bool force, GLvoid* vertices); |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 187 | |
| 188 | /** |
| 189 | * Resets the vertex pointers. |
| 190 | */ |
| 191 | void resetVertexPointers(); |
| 192 | void resetTexCoordsVertexPointer(); |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 193 | |
Romain Guy | 15bc643 | 2011-12-13 13:11:32 -0800 | [diff] [blame] | 194 | void enableTexCoordsVertexArray(); |
| 195 | void disbaleTexCoordsVertexArray(); |
| 196 | |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 197 | /** |
Romain Guy | a1d3c91 | 2011-12-13 14:55:06 -0800 | [diff] [blame] | 198 | * Activate the specified texture unit. The texture unit must |
| 199 | * be specified using an integer number (0 for GL_TEXTURE0 etc.) |
| 200 | */ |
| 201 | void activeTexture(GLuint textureUnit); |
| 202 | |
| 203 | /** |
Romain Guy | 8f85e80 | 2011-12-14 19:23:32 -0800 | [diff] [blame] | 204 | * Sets the scissor for the current surface. |
| 205 | */ |
Romain Guy | 8a4ac61 | 2012-07-17 17:32:48 -0700 | [diff] [blame] | 206 | bool setScissor(GLint x, GLint y, GLint width, GLint height); |
Romain Guy | 8f85e80 | 2011-12-14 19:23:32 -0800 | [diff] [blame] | 207 | |
| 208 | /** |
Romain Guy | 82bc7a7 | 2012-01-03 14:13:39 -0800 | [diff] [blame] | 209 | * Resets the scissor state. |
| 210 | */ |
| 211 | void resetScissor(); |
| 212 | |
Romain Guy | 8a4ac61 | 2012-07-17 17:32:48 -0700 | [diff] [blame] | 213 | bool enableScissor(); |
| 214 | bool disableScissor(); |
Romain Guy | 586cae3 | 2012-07-13 15:28:31 -0700 | [diff] [blame] | 215 | void setScissorEnabled(bool enabled); |
| 216 | |
Romain Guy | ef35927 | 2013-01-31 19:07:29 -0800 | [diff] [blame] | 217 | void startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool discard); |
Romain Guy | 85ef80d | 2012-09-13 20:26:50 -0700 | [diff] [blame] | 218 | void endTiling(); |
| 219 | |
Romain Guy | 82bc7a7 | 2012-01-03 14:13:39 -0800 | [diff] [blame] | 220 | /** |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 221 | * Returns the mesh used to draw regions. Calling this method will |
| 222 | * bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the |
| 223 | * indices for the region mesh. |
| 224 | */ |
| 225 | TextureVertex* getRegionMesh(); |
| 226 | |
Romain Guy | c15008e | 2010-11-10 11:59:15 -0800 | [diff] [blame] | 227 | /** |
| 228 | * Displays the memory usage of each cache and the total sum. |
| 229 | */ |
| 230 | void dumpMemoryUsage(); |
Chet Haase | 9c1e23b | 2011-03-24 10:51:31 -0700 | [diff] [blame] | 231 | void dumpMemoryUsage(String8& log); |
Romain Guy | c15008e | 2010-11-10 11:59:15 -0800 | [diff] [blame] | 232 | |
Romain Guy | 54c1a64 | 2012-09-27 17:55:46 -0700 | [diff] [blame] | 233 | bool hasRegisteredFunctors(); |
| 234 | void registerFunctors(uint32_t functorCount); |
| 235 | void unregisterFunctors(uint32_t functorCount); |
| 236 | |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 237 | bool blend; |
| 238 | GLenum lastSrcMode; |
| 239 | GLenum lastDstMode; |
| 240 | Program* currentProgram; |
Romain Guy | 586cae3 | 2012-07-13 15:28:31 -0700 | [diff] [blame] | 241 | bool scissorEnabled; |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 242 | |
Romain Guy | 746b740 | 2010-10-26 16:27:31 -0700 | [diff] [blame] | 243 | // VBO to draw with |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 244 | GLuint meshBuffer; |
Romain Guy | 03750a0 | 2010-10-18 14:06:08 -0700 | [diff] [blame] | 245 | |
Romain Guy | 746b740 | 2010-10-26 16:27:31 -0700 | [diff] [blame] | 246 | // Misc |
| 247 | GLint maxTextureSize; |
Romain Guy | 4ff0cf4 | 2012-08-06 14:51:10 -0700 | [diff] [blame] | 248 | bool debugLayersUpdates; |
Romain Guy | 7c450aa | 2012-09-21 19:15:00 -0700 | [diff] [blame] | 249 | bool debugOverdraw; |
Romain Guy | 746b740 | 2010-10-26 16:27:31 -0700 | [diff] [blame] | 250 | |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 251 | TextureCache textureCache; |
| 252 | LayerCache layerCache; |
Romain Guy | 8d4aeb7 | 2013-02-12 16:08:55 -0800 | [diff] [blame^] | 253 | RenderBufferCache renderBufferCache; |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 254 | GradientCache gradientCache; |
| 255 | ProgramCache programCache; |
| 256 | PathCache pathCache; |
Romain Guy | 01d58e4 | 2011-01-19 21:54:02 -0800 | [diff] [blame] | 257 | RoundRectShapeCache roundRectShapeCache; |
| 258 | CircleShapeCache circleShapeCache; |
Romain Guy | c1cd9ba3 | 2011-01-23 14:18:41 -0800 | [diff] [blame] | 259 | OvalShapeCache ovalShapeCache; |
| 260 | RectShapeCache rectShapeCache; |
Romain Guy | 8b2f526 | 2011-01-23 16:15:02 -0800 | [diff] [blame] | 261 | ArcShapeCache arcShapeCache; |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 262 | PatchCache patchCache; |
| 263 | TextDropShadowCache dropShadowCache; |
Romain Guy | e2d345e | 2010-09-24 18:39:22 -0700 | [diff] [blame] | 264 | FboCache fboCache; |
Chet Haase | 5c13d89 | 2010-10-08 08:37:55 -0700 | [diff] [blame] | 265 | ResourceCache resourceCache; |
Romain Guy | 29d8997 | 2010-09-22 16:10:57 -0700 | [diff] [blame] | 266 | |
Romain Guy | b1d0a4e | 2012-07-13 18:25:35 -0700 | [diff] [blame] | 267 | GammaFontRenderer* fontRenderer; |
| 268 | |
Romain Guy | 0baaac5 | 2012-08-31 20:31:01 -0700 | [diff] [blame] | 269 | Dither dither; |
Romain Guy | 0baaac5 | 2012-08-31 20:31:01 -0700 | [diff] [blame] | 270 | Stencil stencil; |
Romain Guy | 0baaac5 | 2012-08-31 20:31:01 -0700 | [diff] [blame] | 271 | |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 272 | // Debug methods |
Romain Guy | 13631f3 | 2012-01-30 17:41:55 -0800 | [diff] [blame] | 273 | PFNGLINSERTEVENTMARKEREXTPROC eventMark; |
| 274 | PFNGLPUSHGROUPMARKEREXTPROC startMark; |
| 275 | PFNGLPOPGROUPMARKEREXTPROC endMark; |
| 276 | |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 277 | PFNGLLABELOBJECTEXTPROC setLabel; |
| 278 | PFNGLGETOBJECTLABELEXTPROC getLabel; |
| 279 | |
Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 280 | private: |
Romain Guy | b1d0a4e | 2012-07-13 18:25:35 -0700 | [diff] [blame] | 281 | void initFont(); |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 282 | void initExtensions(); |
| 283 | void initConstraints(); |
| 284 | |
| 285 | static void eventMarkNull(GLsizei length, const GLchar* marker) { } |
| 286 | static void startMarkNull(GLsizei length, const GLchar* marker) { } |
Romain Guy | 13631f3 | 2012-01-30 17:41:55 -0800 | [diff] [blame] | 287 | static void endMarkNull() { } |
| 288 | |
Romain Guy | dfa1046 | 2012-05-12 16:18:58 -0700 | [diff] [blame] | 289 | static void setLabelNull(GLenum type, uint object, GLsizei length, |
| 290 | const char* label) { } |
| 291 | static void getLabelNull(GLenum type, uint object, GLsizei bufferSize, |
| 292 | GLsizei* length, char* label) { |
| 293 | if (length) *length = 0; |
| 294 | if (label) *label = '\0'; |
| 295 | } |
| 296 | |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 297 | GLuint mCurrentBuffer; |
Romain Guy | 15bc643 | 2011-12-13 13:11:32 -0800 | [diff] [blame] | 298 | GLuint mCurrentIndicesBuffer; |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 299 | void* mCurrentPositionPointer; |
Chris Craik | 16b897c | 2012-09-27 13:10:56 -0700 | [diff] [blame] | 300 | GLsizei mCurrentPositionStride; |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 301 | void* mCurrentTexCoordsPointer; |
| 302 | |
Romain Guy | 15bc643 | 2011-12-13 13:11:32 -0800 | [diff] [blame] | 303 | bool mTexCoordsArrayEnabled; |
| 304 | |
Romain Guy | a1d3c91 | 2011-12-13 14:55:06 -0800 | [diff] [blame] | 305 | GLuint mTextureUnit; |
| 306 | |
Romain Guy | 8f85e80 | 2011-12-14 19:23:32 -0800 | [diff] [blame] | 307 | GLint mScissorX; |
| 308 | GLint mScissorY; |
| 309 | GLint mScissorWidth; |
| 310 | GLint mScissorHeight; |
| 311 | |
Romain Guy | 3bbacf2 | 2013-02-06 16:51:04 -0800 | [diff] [blame] | 312 | Extensions& mExtensions; |
| 313 | |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 314 | // Used to render layers |
| 315 | TextureVertex* mRegionMesh; |
| 316 | GLuint mRegionMeshIndices; |
| 317 | |
| 318 | mutable Mutex mGarbageLock; |
| 319 | Vector<Layer*> mLayerGarbage; |
Romain Guy | bb0acdf | 2012-03-05 13:44:35 -0800 | [diff] [blame] | 320 | Vector<DisplayList*> mDisplayListGarbage; |
Romain Guy | f3a910b4 | 2011-12-12 20:35:21 -0800 | [diff] [blame] | 321 | |
Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 322 | DebugLevel mDebugLevel; |
Romain Guy | 8ff6b9e | 2011-11-09 20:10:18 -0800 | [diff] [blame] | 323 | bool mInitialized; |
Romain Guy | 54c1a64 | 2012-09-27 17:55:46 -0700 | [diff] [blame] | 324 | |
| 325 | uint32_t mFunctorsCount; |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 326 | }; // class Caches |
| 327 | |
| 328 | }; // namespace uirenderer |
Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 329 | }; // namespace android |
| 330 | |
Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 331 | #endif // ANDROID_HWUI_CACHES_H |