summaryrefslogtreecommitdiff
path: root/libs/hwui/PathRenderer.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2012-10-01 13:50:37 -0700
committer Chris Craik <ccraik@google.com> 2012-10-01 13:50:37 -0700
commitbf09ffb4e0dc820aeae56a3e576aed33cab218da (patch)
tree23eabf3a77837da300aeab0f442f58868faa3e65 /libs/hwui/PathRenderer.cpp
parentbfbf6e1232013a999f4776f7fdf7cf6fb577f89b (diff)
Quick reject empty paths
bug:7260035 Adding a circle of radius 0 to a path is a no-op in skia, so detect this case both in the PathRenderer, and in quickReject(). Change-Id: I7a172db49a5d5351b4734b39d4e4ca6379658096
Diffstat (limited to 'libs/hwui/PathRenderer.cpp')
-rw-r--r--libs/hwui/PathRenderer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/PathRenderer.cpp b/libs/hwui/PathRenderer.cpp
index 4a66c62d92d8..5b55c2b94589 100644
--- a/libs/hwui/PathRenderer.cpp
+++ b/libs/hwui/PathRenderer.cpp
@@ -323,6 +323,11 @@ void PathRenderer::convexPathVertices(const SkPath &path, const SkPaint* paint,
convexPathPerimeterVertices(path, threshInvScaleX * threshInvScaleX,
threshInvScaleY * threshInvScaleY, tempVertices);
+ if (!tempVertices.size()) {
+ // path was empty, return without allocating vertex buffer
+ return;
+ }
+
#if VERTEX_DEBUG
for (unsigned int i = 0; i < tempVertices.size(); i++) {
ALOGD("orig path: point at %f %f", tempVertices[i].position[0], tempVertices[i].position[1]);