diff options
author | 2012-10-01 13:50:37 -0700 | |
---|---|---|
committer | 2012-10-01 13:50:37 -0700 | |
commit | bf09ffb4e0dc820aeae56a3e576aed33cab218da (patch) | |
tree | 23eabf3a77837da300aeab0f442f58868faa3e65 /libs/hwui/OpenGLRenderer.cpp | |
parent | bfbf6e1232013a999f4776f7fdf7cf6fb577f89b (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/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index c0150776b76c..c2e6ee39a9c9 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1265,7 +1265,7 @@ bool OpenGLRenderer::quickRejectPreStroke(float left, float top, float right, fl } bool OpenGLRenderer::quickReject(float left, float top, float right, float bottom) { - if (mSnapshot->isIgnored()) { + if (mSnapshot->isIgnored() || bottom <= top || right <= left) { return true; } @@ -1951,6 +1951,11 @@ void OpenGLRenderer::drawConvexPath(const SkPath& path, SkPaint* paint) { // TODO: try clipping large paths to viewport PathRenderer::convexPathVertices(path, paint, mSnapshot->transform, vertexBuffer); + if (!vertexBuffer.getSize()) { + // no vertices to draw + return; + } + setupDraw(); setupDrawNoTexture(); if (isAA) setupDrawAA(); |