diff options
author | 2014-06-10 17:22:31 +0000 | |
---|---|---|
committer | 2014-06-10 17:22:31 +0000 | |
commit | 1e5cf9aced40e6e14262e542d0ed0e24cda877a0 (patch) | |
tree | 1b42070defc0a41277e27ae37c92748dec18fc99 /libs/hwui/AmbientShadow.cpp | |
parent | f1d758867aa878fb956af7c66bd2d3122adf72a0 (diff) | |
parent | 9a9d1d5ad2591f04881a401da0ad89a95eeddd00 (diff) |
am b1c76a1a: Merge "Tessellate on worker threads" into lmp-preview-dev
* commit 'b1c76a1abcfb2f33e12fef37ec71d20724863b5e':
Tessellate on worker threads
Diffstat (limited to 'libs/hwui/AmbientShadow.cpp')
-rw-r--r-- | libs/hwui/AmbientShadow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp index c1af5f52efd6..937b7c622c62 100644 --- a/libs/hwui/AmbientShadow.cpp +++ b/libs/hwui/AmbientShadow.cpp @@ -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 @@ -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); @@ -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++) { @@ -142,7 +143,6 @@ VertexBufferMode AmbientShadow::createAmbientShadow(bool isCasterOpaque, shadowVertices[i].y, shadowVertices[i].alpha); } #endif - return mode; } /** |