Loading libs/hwui/OpenGLRenderer.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1262,7 +1262,7 @@ void OpenGLRenderer::attachStencilBufferToLayer(Layer* layer) { endTiling(); endTiling(); RenderBuffer* buffer = mCaches.renderBufferCache.get( RenderBuffer* buffer = mCaches.renderBufferCache.get( Stencil::getSmallestStencilFormat(), Stencil::getLayerStencilFormat(), layer->getWidth(), layer->getHeight()); layer->getWidth(), layer->getHeight()); layer->setStencilRenderBuffer(buffer); layer->setStencilRenderBuffer(buffer); Loading libs/hwui/renderstate/Stencil.cpp +9 −4 Original line number Original line Diff line number Diff line Loading @@ -42,12 +42,17 @@ uint8_t Stencil::getStencilSize() { return STENCIL_BUFFER_SIZE; return STENCIL_BUFFER_SIZE; } } GLenum Stencil::getSmallestStencilFormat() { /** * This method will return either GL_STENCIL_INDEX4_OES if supported, * GL_STENCIL_INDEX8 if not. * * Layers can't use a single bit stencil because multi-rect ClipArea needs a high enough * stencil resolution to represent the summation of multiple intersecting rect geometries. */ GLenum Stencil::getLayerStencilFormat() { #if !DEBUG_STENCIL #if !DEBUG_STENCIL const Extensions& extensions = Caches::getInstance().extensions(); const Extensions& extensions = Caches::getInstance().extensions(); if (extensions.has1BitStencil()) { if (extensions.has4BitStencil()) { return GL_STENCIL_INDEX1_OES; } else if (extensions.has4BitStencil()) { return GL_STENCIL_INDEX4_OES; return GL_STENCIL_INDEX4_OES; } } #endif #endif Loading libs/hwui/renderstate/Stencil.h +1 −4 Original line number Original line Diff line number Diff line Loading @@ -42,10 +42,7 @@ public: */ */ ANDROID_API static uint8_t getStencilSize(); ANDROID_API static uint8_t getStencilSize(); /** static GLenum getLayerStencilFormat(); * Returns the smallest stencil format accepted by render buffers. */ static GLenum getSmallestStencilFormat(); /** /** * Clears the stencil buffer. * Clears the stencil buffer. Loading Loading
libs/hwui/OpenGLRenderer.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1262,7 +1262,7 @@ void OpenGLRenderer::attachStencilBufferToLayer(Layer* layer) { endTiling(); endTiling(); RenderBuffer* buffer = mCaches.renderBufferCache.get( RenderBuffer* buffer = mCaches.renderBufferCache.get( Stencil::getSmallestStencilFormat(), Stencil::getLayerStencilFormat(), layer->getWidth(), layer->getHeight()); layer->getWidth(), layer->getHeight()); layer->setStencilRenderBuffer(buffer); layer->setStencilRenderBuffer(buffer); Loading
libs/hwui/renderstate/Stencil.cpp +9 −4 Original line number Original line Diff line number Diff line Loading @@ -42,12 +42,17 @@ uint8_t Stencil::getStencilSize() { return STENCIL_BUFFER_SIZE; return STENCIL_BUFFER_SIZE; } } GLenum Stencil::getSmallestStencilFormat() { /** * This method will return either GL_STENCIL_INDEX4_OES if supported, * GL_STENCIL_INDEX8 if not. * * Layers can't use a single bit stencil because multi-rect ClipArea needs a high enough * stencil resolution to represent the summation of multiple intersecting rect geometries. */ GLenum Stencil::getLayerStencilFormat() { #if !DEBUG_STENCIL #if !DEBUG_STENCIL const Extensions& extensions = Caches::getInstance().extensions(); const Extensions& extensions = Caches::getInstance().extensions(); if (extensions.has1BitStencil()) { if (extensions.has4BitStencil()) { return GL_STENCIL_INDEX1_OES; } else if (extensions.has4BitStencil()) { return GL_STENCIL_INDEX4_OES; return GL_STENCIL_INDEX4_OES; } } #endif #endif Loading
libs/hwui/renderstate/Stencil.h +1 −4 Original line number Original line Diff line number Diff line Loading @@ -42,10 +42,7 @@ public: */ */ ANDROID_API static uint8_t getStencilSize(); ANDROID_API static uint8_t getStencilSize(); /** static GLenum getLayerStencilFormat(); * Returns the smallest stencil format accepted by render buffers. */ static GLenum getSmallestStencilFormat(); /** /** * Clears the stencil buffer. * Clears the stencil buffer. Loading