Loading libs/hwui/Caches.cpp +28 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,10 @@ bool Caches::unbindIndicesBuffer() { return false; } /////////////////////////////////////////////////////////////////////////////// // Meshes and textures /////////////////////////////////////////////////////////////////////////////// void Caches::bindPositionVertexPointer(bool force, GLuint slot, GLvoid* vertices, GLsizei stride) { if (force || vertices != mCurrentPositionPointer) { glVertexAttribPointer(slot, 2, GL_FLOAT, GL_FALSE, stride, vertices); Loading Loading @@ -366,6 +370,10 @@ void Caches::activeTexture(GLuint textureUnit) { } } /////////////////////////////////////////////////////////////////////////////// // Scissor /////////////////////////////////////////////////////////////////////////////// bool Caches::setScissor(GLint x, GLint y, GLint width, GLint height) { if (scissorEnabled && (x != mScissorX || y != mScissorY || width != mScissorWidth || height != mScissorHeight)) { Loading Loading @@ -412,6 +420,26 @@ void Caches::resetScissor() { mScissorX = mScissorY = mScissorWidth = mScissorHeight = 0; } /////////////////////////////////////////////////////////////////////////////// // Tiling /////////////////////////////////////////////////////////////////////////////// void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque) { if (extensions.hasTiledRendering()) { } } void Caches::endTiling() { if (extensions.hasTiledRendering()) { } } /////////////////////////////////////////////////////////////////////////////// // Regions /////////////////////////////////////////////////////////////////////////////// TextureVertex* Caches::getRegionMesh() { // Create the mesh, 2 triangles and 4 vertices per rectangle in the region if (!mRegionMesh) { Loading libs/hwui/Caches.h +3 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,9 @@ public: bool disableScissor(); void setScissorEnabled(bool enabled); void startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque); void endTiling(); /** * Returns the mesh used to draw regions. Calling this method will * bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the Loading libs/hwui/Extensions.h +9 −5 Original line number Diff line number Diff line Loading @@ -65,11 +65,13 @@ public: mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer"); mHasDebugMarker = hasExtension("GL_EXT_debug_marker"); mHasDebugLabel = hasExtension("GL_EXT_debug_label"); mHasTiledRendering = hasExtension("GL_QCOM_tiled_rendering"); // We don't need to copy the string, the OpenGL ES spec // guarantees the result of glGetString to point to a // static string as long as our OpenGL context is valid mExtensions = buffer; mExtensions = strdup(buffer); } ~Extensions() { free(mExtensions); } inline bool hasNPot() const { return mHasNPot; } Loading @@ -77,6 +79,7 @@ public: inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } inline bool hasDebugMarker() const { return mHasDebugMarker; } inline bool hasDebugLabel() const { return mHasDebugLabel; } inline bool hasTiledRendering() const { return mHasTiledRendering; } bool hasExtension(const char* extension) const { const String8 s(extension); Loading @@ -90,13 +93,14 @@ public: private: SortedVector<String8> mExtensionList; const char* mExtensions; char* mExtensions; bool mHasNPot; bool mHasFramebufferFetch; bool mHasDiscardFramebuffer; bool mHasDebugMarker; bool mHasDebugLabel; bool mHasTiledRendering; }; // class Extensions }; // namespace uirenderer Loading Loading
libs/hwui/Caches.cpp +28 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,10 @@ bool Caches::unbindIndicesBuffer() { return false; } /////////////////////////////////////////////////////////////////////////////// // Meshes and textures /////////////////////////////////////////////////////////////////////////////// void Caches::bindPositionVertexPointer(bool force, GLuint slot, GLvoid* vertices, GLsizei stride) { if (force || vertices != mCurrentPositionPointer) { glVertexAttribPointer(slot, 2, GL_FLOAT, GL_FALSE, stride, vertices); Loading Loading @@ -366,6 +370,10 @@ void Caches::activeTexture(GLuint textureUnit) { } } /////////////////////////////////////////////////////////////////////////////// // Scissor /////////////////////////////////////////////////////////////////////////////// bool Caches::setScissor(GLint x, GLint y, GLint width, GLint height) { if (scissorEnabled && (x != mScissorX || y != mScissorY || width != mScissorWidth || height != mScissorHeight)) { Loading Loading @@ -412,6 +420,26 @@ void Caches::resetScissor() { mScissorX = mScissorY = mScissorWidth = mScissorHeight = 0; } /////////////////////////////////////////////////////////////////////////////// // Tiling /////////////////////////////////////////////////////////////////////////////// void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque) { if (extensions.hasTiledRendering()) { } } void Caches::endTiling() { if (extensions.hasTiledRendering()) { } } /////////////////////////////////////////////////////////////////////////////// // Regions /////////////////////////////////////////////////////////////////////////////// TextureVertex* Caches::getRegionMesh() { // Create the mesh, 2 triangles and 4 vertices per rectangle in the region if (!mRegionMesh) { Loading
libs/hwui/Caches.h +3 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,9 @@ public: bool disableScissor(); void setScissorEnabled(bool enabled); void startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque); void endTiling(); /** * Returns the mesh used to draw regions. Calling this method will * bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the Loading
libs/hwui/Extensions.h +9 −5 Original line number Diff line number Diff line Loading @@ -65,11 +65,13 @@ public: mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer"); mHasDebugMarker = hasExtension("GL_EXT_debug_marker"); mHasDebugLabel = hasExtension("GL_EXT_debug_label"); mHasTiledRendering = hasExtension("GL_QCOM_tiled_rendering"); // We don't need to copy the string, the OpenGL ES spec // guarantees the result of glGetString to point to a // static string as long as our OpenGL context is valid mExtensions = buffer; mExtensions = strdup(buffer); } ~Extensions() { free(mExtensions); } inline bool hasNPot() const { return mHasNPot; } Loading @@ -77,6 +79,7 @@ public: inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } inline bool hasDebugMarker() const { return mHasDebugMarker; } inline bool hasDebugLabel() const { return mHasDebugLabel; } inline bool hasTiledRendering() const { return mHasTiledRendering; } bool hasExtension(const char* extension) const { const String8 s(extension); Loading @@ -90,13 +93,14 @@ public: private: SortedVector<String8> mExtensionList; const char* mExtensions; char* mExtensions; bool mHasNPot; bool mHasFramebufferFetch; bool mHasDiscardFramebuffer; bool mHasDebugMarker; bool mHasDebugLabel; bool mHasTiledRendering; }; // class Extensions }; // namespace uirenderer Loading