Loading libs/hwui/AmbientShadow.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ inline bool needsExtraForEdge(float firstAlpha, float secondAlpha) { void AmbientShadow::createAmbientShadow(bool isCasterOpaque, const Vector3* casterVertices, int casterVertexCount, const Vector3& centroid3d, float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer) { shadowVertexBuffer.setMode(VertexBuffer::kIndices); shadowVertexBuffer.setMeshFeatureFlags(VertexBuffer::kAlpha | VertexBuffer::kIndices); // In order to computer the outer vertices in one loop, we need pre-compute // the normal by the vertex (n - 1) to vertex 0, and the spike and alpha value Loading libs/hwui/Caches.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -48,10 +48,11 @@ Caches* Caches::sInstance = nullptr; /////////////////////////////////////////////////////////////////////////////// Caches::Caches(RenderState& renderState) : patchCache(renderState) : gradientCache(mExtensions) , patchCache(renderState) , programCache(mExtensions) , dither(*this) , mRenderState(&renderState) , mExtensions(Extensions::getInstance()) , mInitialized(false) { INIT_LOGD("Creating OpenGL renderer caches"); init(); Loading Loading @@ -187,9 +188,9 @@ bool Caches::initProperties() { INIT_LOGD(" Draw reorder enabled"); } return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || (prevDebugStencilClip != debugStencilClip); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || (prevDebugStencilClip != debugStencilClip); } void Caches::terminate() { Loading libs/hwui/Caches.h +8 −4 Original line number Diff line number Diff line Loading @@ -178,14 +178,18 @@ public: kStencilShowRegion }; StencilClipDebug debugStencilClip; private: // Declared before gradientCache and programCache which need this to initialize. // TODO: cleanup / move elsewhere Extensions mExtensions; public: TextureCache textureCache; LayerCache layerCache; RenderBufferCache renderBufferCache; GradientCache gradientCache; ProgramCache programCache; PathCache pathCache; PatchCache patchCache; PathCache pathCache; ProgramCache programCache; TessellationCache tessellationCache; TextDropShadowCache dropShadowCache; FboCache fboCache; Loading Loading @@ -220,6 +224,7 @@ public: void setProgram(const ProgramDescription& description); void setProgram(Program* program); Extensions& extensions() { return mExtensions; } Program& program() { return *mProgram; } PixelBufferState& pixelBufferState() { return *mPixelBufferState; } TextureState& textureState() { return *mTextureState; } Loading Loading @@ -248,7 +253,6 @@ private: } RenderState* mRenderState; Extensions& mExtensions; // Used to render layers std::unique_ptr<TextureVertex[]> mRegionMesh; Loading libs/hwui/Dither.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -32,8 +32,6 @@ Dither::Dither(Caches& caches) void Dither::bindDitherTexture() { if (!mInitialized) { bool useFloatTexture = Extensions::getInstance().hasFloatTextures(); glGenTextures(1, &mDitherTexture); mCaches.textureState().bindTexture(mDitherTexture); Loading @@ -43,7 +41,7 @@ void Dither::bindDitherTexture() { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); if (useFloatTexture) { if (mCaches.extensions().hasFloatTextures()) { // We use a R16F texture, let's remap the alpha channel to the // red channel to avoid changing the shader sampling code on GL ES 3.0+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED); Loading libs/hwui/Dither.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ namespace android { namespace uirenderer { class Caches; class Extensions; class Program; // Must be a power of two Loading Loading
libs/hwui/AmbientShadow.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -179,7 +179,7 @@ inline bool needsExtraForEdge(float firstAlpha, float secondAlpha) { void AmbientShadow::createAmbientShadow(bool isCasterOpaque, const Vector3* casterVertices, int casterVertexCount, const Vector3& centroid3d, float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer) { shadowVertexBuffer.setMode(VertexBuffer::kIndices); shadowVertexBuffer.setMeshFeatureFlags(VertexBuffer::kAlpha | VertexBuffer::kIndices); // In order to computer the outer vertices in one loop, we need pre-compute // the normal by the vertex (n - 1) to vertex 0, and the spike and alpha value Loading
libs/hwui/Caches.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -48,10 +48,11 @@ Caches* Caches::sInstance = nullptr; /////////////////////////////////////////////////////////////////////////////// Caches::Caches(RenderState& renderState) : patchCache(renderState) : gradientCache(mExtensions) , patchCache(renderState) , programCache(mExtensions) , dither(*this) , mRenderState(&renderState) , mExtensions(Extensions::getInstance()) , mInitialized(false) { INIT_LOGD("Creating OpenGL renderer caches"); init(); Loading Loading @@ -187,9 +188,9 @@ bool Caches::initProperties() { INIT_LOGD(" Draw reorder enabled"); } return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || (prevDebugStencilClip != debugStencilClip); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) || (prevDebugStencilClip != debugStencilClip); } void Caches::terminate() { Loading
libs/hwui/Caches.h +8 −4 Original line number Diff line number Diff line Loading @@ -178,14 +178,18 @@ public: kStencilShowRegion }; StencilClipDebug debugStencilClip; private: // Declared before gradientCache and programCache which need this to initialize. // TODO: cleanup / move elsewhere Extensions mExtensions; public: TextureCache textureCache; LayerCache layerCache; RenderBufferCache renderBufferCache; GradientCache gradientCache; ProgramCache programCache; PathCache pathCache; PatchCache patchCache; PathCache pathCache; ProgramCache programCache; TessellationCache tessellationCache; TextDropShadowCache dropShadowCache; FboCache fboCache; Loading Loading @@ -220,6 +224,7 @@ public: void setProgram(const ProgramDescription& description); void setProgram(Program* program); Extensions& extensions() { return mExtensions; } Program& program() { return *mProgram; } PixelBufferState& pixelBufferState() { return *mPixelBufferState; } TextureState& textureState() { return *mTextureState; } Loading Loading @@ -248,7 +253,6 @@ private: } RenderState* mRenderState; Extensions& mExtensions; // Used to render layers std::unique_ptr<TextureVertex[]> mRegionMesh; Loading
libs/hwui/Dither.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -32,8 +32,6 @@ Dither::Dither(Caches& caches) void Dither::bindDitherTexture() { if (!mInitialized) { bool useFloatTexture = Extensions::getInstance().hasFloatTextures(); glGenTextures(1, &mDitherTexture); mCaches.textureState().bindTexture(mDitherTexture); Loading @@ -43,7 +41,7 @@ void Dither::bindDitherTexture() { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); if (useFloatTexture) { if (mCaches.extensions().hasFloatTextures()) { // We use a R16F texture, let's remap the alpha channel to the // red channel to avoid changing the shader sampling code on GL ES 3.0+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED); Loading
libs/hwui/Dither.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ namespace android { namespace uirenderer { class Caches; class Extensions; class Program; // Must be a power of two Loading