Loading libs/hwui/Caches.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -435,15 +435,13 @@ void Caches::resetScissor() { /////////////////////////////////////////////////////////////////////////////// void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque) { if (extensions.hasTiledRendering()) { glStartTilingQCOM(x, y, width, height, (opaque ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM) | (debugOverdraw ? GL_STENCIL_BUFFER_BIT0_QCOM : 0)); if (extensions.hasTiledRendering() && !debugOverdraw) { glStartTilingQCOM(x, y, width, height, (opaque ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM)); } } void Caches::endTiling() { if (extensions.hasTiledRendering()) { if (extensions.hasTiledRendering() && !debugOverdraw) { glEndTilingQCOM(GL_COLOR_BUFFER_BIT0_QCOM); } } Loading libs/hwui/font/CacheTexture.h +21 −23 Original line number Diff line number Diff line Loading @@ -78,12 +78,7 @@ public: } ~CacheTexture() { if (mTexture) { delete[] mTexture; } if (mTextureId) { glDeleteTextures(1, &mTextureId); } releaseTexture(); reset(); } Loading @@ -106,30 +101,31 @@ public: void releaseTexture() { if (mTexture) { glDeleteTextures(1, &mTextureId); delete[] mTexture; mTexture = NULL; } if (mTextureId) { glDeleteTextures(1, &mTextureId); mTextureId = 0; } mDirty = false; } /** * This method assumes that the proper texture unit is active. */ void allocateTexture() { int width = mWidth; int height = mHeight; mTexture = new uint8_t[width * height]; if (!mTexture) { mTexture = new uint8_t[mWidth * mHeight]; } if (!mTextureId) { glGenTextures(1, &mTextureId); } glBindTexture(GL_TEXTURE_2D, mTextureId); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // Initialize texture dimensions glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, mWidth, mHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0); const GLenum filtering = getLinearFiltering() ? GL_LINEAR : GL_NEAREST; Loading @@ -139,6 +135,7 @@ public: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } } bool fitBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint32_t* retOriginY); Loading @@ -158,7 +155,8 @@ public: return mTexture; } inline GLuint getTextureId() const { GLuint getTextureId() { allocateTexture(); return mTextureId; } Loading Loading
libs/hwui/Caches.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -435,15 +435,13 @@ void Caches::resetScissor() { /////////////////////////////////////////////////////////////////////////////// void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque) { if (extensions.hasTiledRendering()) { glStartTilingQCOM(x, y, width, height, (opaque ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM) | (debugOverdraw ? GL_STENCIL_BUFFER_BIT0_QCOM : 0)); if (extensions.hasTiledRendering() && !debugOverdraw) { glStartTilingQCOM(x, y, width, height, (opaque ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM)); } } void Caches::endTiling() { if (extensions.hasTiledRendering()) { if (extensions.hasTiledRendering() && !debugOverdraw) { glEndTilingQCOM(GL_COLOR_BUFFER_BIT0_QCOM); } } Loading
libs/hwui/font/CacheTexture.h +21 −23 Original line number Diff line number Diff line Loading @@ -78,12 +78,7 @@ public: } ~CacheTexture() { if (mTexture) { delete[] mTexture; } if (mTextureId) { glDeleteTextures(1, &mTextureId); } releaseTexture(); reset(); } Loading @@ -106,30 +101,31 @@ public: void releaseTexture() { if (mTexture) { glDeleteTextures(1, &mTextureId); delete[] mTexture; mTexture = NULL; } if (mTextureId) { glDeleteTextures(1, &mTextureId); mTextureId = 0; } mDirty = false; } /** * This method assumes that the proper texture unit is active. */ void allocateTexture() { int width = mWidth; int height = mHeight; mTexture = new uint8_t[width * height]; if (!mTexture) { mTexture = new uint8_t[mWidth * mHeight]; } if (!mTextureId) { glGenTextures(1, &mTextureId); } glBindTexture(GL_TEXTURE_2D, mTextureId); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // Initialize texture dimensions glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, mWidth, mHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0); const GLenum filtering = getLinearFiltering() ? GL_LINEAR : GL_NEAREST; Loading @@ -139,6 +135,7 @@ public: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } } bool fitBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint32_t* retOriginY); Loading @@ -158,7 +155,8 @@ public: return mTexture; } inline GLuint getTextureId() const { GLuint getTextureId() { allocateTexture(); return mTextureId; } Loading