Don't draw entirely transparent 9patch meshes.
Change-Id: If3e62e18b8e0dbde8a22f8ede2889b86500a4dc2
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 97bb73f..481e2df 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -724,11 +724,13 @@
const Patch* mesh = mCaches.patchCache.get(bitmap->width(), bitmap->height(),
right - left, bottom - top, xDivs, yDivs, colors, width, height, numColors);
- // Specify right and bottom as +1.0f from left/top to prevent scaling since the
- // patch mesh already defines the final size
- drawTextureMesh(left, top, left + 1.0f, top + 1.0f, texture->id, alpha / 255.0f,
- mode, texture->blend, &mesh->vertices[0].position[0],
- &mesh->vertices[0].texture[0], GL_TRIANGLES, mesh->verticesCount);
+ if (mesh) {
+ // Specify right and bottom as +1.0f from left/top to prevent scaling since the
+ // patch mesh already defines the final size
+ drawTextureMesh(left, top, left + 1.0f, top + 1.0f, texture->id, alpha / 255.0f,
+ mode, texture->blend, &mesh->vertices[0].position[0],
+ &mesh->vertices[0].texture[0], GL_TRIANGLES, mesh->verticesCount);
+ }
}
void OpenGLRenderer::drawLines(float* points, int count, const SkPaint* paint) {