Loading libs/hwui/AmbientShadow.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -44,18 +44,18 @@ namespace uirenderer { * @param shadowVertexBuffer Return an floating point array of (x, y, a) * triangle strips mode. */ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, void AmbientShadow::createAmbientShadow(bool isCasterOpaque, const Vector3* vertices, int vertexCount, const Vector3& centroid3d, float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer) { const int rays = SHADOW_RAY_COUNT; VertexBufferMode mode = kVertexBufferMode_OnePolyRingShadow; VertexBuffer::Mode mode = VertexBuffer::kOnePolyRingShadow; // Validate the inputs. if (vertexCount < 3 || heightFactor <= 0 || rays <= 0 || geomFactor <= 0) { #if DEBUG_SHADOW ALOGW("Invalid input for createAmbientShadow(), early return!"); #endif return mode; // vertex buffer is empty, so any mode doesn't matter. return; } Vector<Vector2> dir; // TODO: use C++11 unique_ptr Loading Loading @@ -127,7 +127,7 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, // If caster isn't opaque, we need to to fill the umbra by storing the umbra's // centroid in the innermost ring of vertices. if (!isCasterOpaque) { mode = kVertexBufferMode_TwoPolyRingShadow; mode = VertexBuffer::kTwoPolyRingShadow; float centroidAlpha = 1.0 / (1 + centroid3d.z * heightFactor); AlphaVertex centroidXYA; AlphaVertex::set(¢roidXYA, centroid2d.x, centroid2d.y, centroidAlpha); Loading @@ -135,6 +135,7 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, shadowVertices[2 * rays + rayIndex] = centroidXYA; } } shadowVertexBuffer.setMode(mode); #if DEBUG_SHADOW for (int i = 0; i < SHADOW_VERTEX_COUNT; i++) { Loading @@ -142,7 +143,6 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, shadowVertices[i].y, shadowVertices[i].alpha); } #endif return mode; } /** Loading libs/hwui/AmbientShadow.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ namespace uirenderer { */ class AmbientShadow { public: static VertexBufferMode createAmbientShadow(bool isCasterOpaque, const Vector3* poly, static void createAmbientShadow(bool isCasterOpaque, const Vector3* poly, int polyLength, const Vector3& centroid3d, float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer); Loading libs/hwui/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ ifeq ($(USE_OPENGL_RENDERER),true) SpotShadow.cpp \ StatefulBaseRenderer.cpp \ Stencil.cpp \ TessellationCache.cpp \ Texture.cpp \ TextureCache.cpp \ TextDropShadowCache.cpp Loading libs/hwui/Caches.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,8 @@ void Caches::dumpMemoryUsage(String8 &log) { gradientCache.getSize(), gradientCache.getMaxSize()); log.appendFormat(" PathCache %8d / %8d\n", pathCache.getSize(), pathCache.getMaxSize()); log.appendFormat(" TessellationCache %8d / %8d\n", tessellationCache.getSize(), tessellationCache.getMaxSize()); log.appendFormat(" TextDropShadowCache %8d / %8d\n", dropShadowCache.getSize(), dropShadowCache.getMaxSize()); log.appendFormat(" PatchCache %8d / %8d\n", Loading @@ -295,6 +297,7 @@ void Caches::dumpMemoryUsage(String8 &log) { total += renderBufferCache.getSize(); total += gradientCache.getSize(); total += pathCache.getSize(); total += tessellationCache.getSize(); total += dropShadowCache.getSize(); total += patchCache.getSize(); for (uint32_t i = 0; i < fontRenderer->getFontRendererCount(); i++) { Loading Loading @@ -358,6 +361,7 @@ void Caches::flush(FlushMode mode) { fontRenderer->flush(); textureCache.flush(); pathCache.clear(); tessellationCache.clear(); // fall through case kFlushMode_Layers: layerCache.clear(); Loading libs/hwui/Caches.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include "PatchCache.h" #include "ProgramCache.h" #include "PathCache.h" #include "TessellationCache.h" #include "TextDropShadowCache.h" #include "FboCache.h" #include "ResourceCache.h" Loading Loading @@ -326,6 +327,7 @@ public: ProgramCache programCache; PathCache pathCache; PatchCache patchCache; TessellationCache tessellationCache; TextDropShadowCache dropShadowCache; FboCache fboCache; ResourceCache resourceCache; Loading Loading
libs/hwui/AmbientShadow.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -44,18 +44,18 @@ namespace uirenderer { * @param shadowVertexBuffer Return an floating point array of (x, y, a) * triangle strips mode. */ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, void AmbientShadow::createAmbientShadow(bool isCasterOpaque, const Vector3* vertices, int vertexCount, const Vector3& centroid3d, float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer) { const int rays = SHADOW_RAY_COUNT; VertexBufferMode mode = kVertexBufferMode_OnePolyRingShadow; VertexBuffer::Mode mode = VertexBuffer::kOnePolyRingShadow; // Validate the inputs. if (vertexCount < 3 || heightFactor <= 0 || rays <= 0 || geomFactor <= 0) { #if DEBUG_SHADOW ALOGW("Invalid input for createAmbientShadow(), early return!"); #endif return mode; // vertex buffer is empty, so any mode doesn't matter. return; } Vector<Vector2> dir; // TODO: use C++11 unique_ptr Loading Loading @@ -127,7 +127,7 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, // If caster isn't opaque, we need to to fill the umbra by storing the umbra's // centroid in the innermost ring of vertices. if (!isCasterOpaque) { mode = kVertexBufferMode_TwoPolyRingShadow; mode = VertexBuffer::kTwoPolyRingShadow; float centroidAlpha = 1.0 / (1 + centroid3d.z * heightFactor); AlphaVertex centroidXYA; AlphaVertex::set(¢roidXYA, centroid2d.x, centroid2d.y, centroidAlpha); Loading @@ -135,6 +135,7 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, shadowVertices[2 * rays + rayIndex] = centroidXYA; } } shadowVertexBuffer.setMode(mode); #if DEBUG_SHADOW for (int i = 0; i < SHADOW_VERTEX_COUNT; i++) { Loading @@ -142,7 +143,6 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, shadowVertices[i].y, shadowVertices[i].alpha); } #endif return mode; } /** Loading
libs/hwui/AmbientShadow.h +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ namespace uirenderer { */ class AmbientShadow { public: static VertexBufferMode createAmbientShadow(bool isCasterOpaque, const Vector3* poly, static void createAmbientShadow(bool isCasterOpaque, const Vector3* poly, int polyLength, const Vector3& centroid3d, float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer); Loading
libs/hwui/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ ifeq ($(USE_OPENGL_RENDERER),true) SpotShadow.cpp \ StatefulBaseRenderer.cpp \ Stencil.cpp \ TessellationCache.cpp \ Texture.cpp \ TextureCache.cpp \ TextDropShadowCache.cpp Loading
libs/hwui/Caches.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,8 @@ void Caches::dumpMemoryUsage(String8 &log) { gradientCache.getSize(), gradientCache.getMaxSize()); log.appendFormat(" PathCache %8d / %8d\n", pathCache.getSize(), pathCache.getMaxSize()); log.appendFormat(" TessellationCache %8d / %8d\n", tessellationCache.getSize(), tessellationCache.getMaxSize()); log.appendFormat(" TextDropShadowCache %8d / %8d\n", dropShadowCache.getSize(), dropShadowCache.getMaxSize()); log.appendFormat(" PatchCache %8d / %8d\n", Loading @@ -295,6 +297,7 @@ void Caches::dumpMemoryUsage(String8 &log) { total += renderBufferCache.getSize(); total += gradientCache.getSize(); total += pathCache.getSize(); total += tessellationCache.getSize(); total += dropShadowCache.getSize(); total += patchCache.getSize(); for (uint32_t i = 0; i < fontRenderer->getFontRendererCount(); i++) { Loading Loading @@ -358,6 +361,7 @@ void Caches::flush(FlushMode mode) { fontRenderer->flush(); textureCache.flush(); pathCache.clear(); tessellationCache.clear(); // fall through case kFlushMode_Layers: layerCache.clear(); Loading
libs/hwui/Caches.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ #include "PatchCache.h" #include "ProgramCache.h" #include "PathCache.h" #include "TessellationCache.h" #include "TextDropShadowCache.h" #include "FboCache.h" #include "ResourceCache.h" Loading Loading @@ -326,6 +327,7 @@ public: ProgramCache programCache; PathCache pathCache; PatchCache patchCache; TessellationCache tessellationCache; TextDropShadowCache dropShadowCache; FboCache fboCache; ResourceCache resourceCache; Loading