summaryrefslogtreecommitdiffstats
path: root/libs/hwui/AmbientShadow.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-01-02 16:46:18 -0800
committerChris Craik <ccraik@google.com>2014-01-02 16:52:32 -0800
commit564acf7c9bff822f608cda0d5df0a64a9f9aaefd (patch)
tree93a3203fc99098dedd4df5660c96d6800c97ae93 /libs/hwui/AmbientShadow.cpp
parente459367a3a49cbe94dfe38c50369431614dddc9c (diff)
downloadframeworks_base-564acf7c9bff822f608cda0d5df0a64a9f9aaefd.zip
frameworks_base-564acf7c9bff822f608cda0d5df0a64a9f9aaefd.tar.gz
frameworks_base-564acf7c9bff822f608cda0d5df0a64a9f9aaefd.tar.bz2
Fix Clang warnings/errors
Fix several build warnings (struct != class, int != size_t) and errors (variable leng non-POD arrays). Change-Id: I70b4e784365514303d8954bfcb1f39d7c22c1321
Diffstat (limited to 'libs/hwui/AmbientShadow.cpp')
-rw-r--r--libs/hwui/AmbientShadow.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp
index 923571e..1f5d26c 100644
--- a/libs/hwui/AmbientShadow.cpp
+++ b/libs/hwui/AmbientShadow.cpp
@@ -18,6 +18,7 @@
#include <math.h>
#include <utils/Log.h>
+#include <utils/Vector.h>
#include "AmbientShadow.h"
#include "Vertex.h"
@@ -60,10 +61,11 @@ void AmbientShadow::createAmbientShadow(const Vector3* vertices, int vertexCount
Vector2 centroid;
calculatePolygonCentroid(vertices, vertexCount, centroid);
- Vector2 dir[rays];
+ Vector<Vector2> dir; // TODO: use C++11 unique_ptr
+ dir.setCapacity(rays);
float rayDist[rays];
float rayHeight[rays];
- calculateRayDirections(rays, dir);
+ calculateRayDirections(rays, dir.editArray());
// Calculate the length and height of the points along the edge.
//
@@ -105,7 +107,7 @@ void AmbientShadow::createAmbientShadow(const Vector3* vertices, int vertexCount
for (int i = 0; i < rays; i++) {
Vector2 normal(1.0f, 0.0f);
- calculateNormal(rays, i, dir, rayDist, normal);
+ calculateNormal(rays, i, dir.array(), rayDist, normal);
float opacity = strength * (0.5f) / (1 + rayHeight[i] / heightFactor);