summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index a72045b..5d30b1a 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -436,6 +436,9 @@ void OpenGLRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, const S
}
const Texture* texture = mTextureCache.get(bitmap);
+ if (!texture) return;
+ const AutoTexture autoCleanup(texture);
+
drawTextureRect(left, top, right, bottom, texture, paint);
}
@@ -449,6 +452,9 @@ void OpenGLRenderer::drawBitmap(SkBitmap* bitmap, const SkMatrix* matrix, const
}
const Texture* texture = mTextureCache.get(bitmap);
+ if (!texture) return;
+ const AutoTexture autoCleanup(texture);
+
drawTextureRect(r.left, r.top, r.right, r.bottom, texture, paint);
}
@@ -461,6 +467,8 @@ void OpenGLRenderer::drawBitmap(SkBitmap* bitmap,
}
const Texture* texture = mTextureCache.get(bitmap);
+ if (!texture) return;
+ const AutoTexture autoCleanup(texture);
const float width = texture->width;
const float height = texture->height;
@@ -484,6 +492,8 @@ void OpenGLRenderer::drawPatch(SkBitmap* bitmap, Res_png_9patch* patch,
}
const Texture* texture = mTextureCache.get(bitmap);
+ if (!texture) return;
+ const AutoTexture autoCleanup(texture);
int alpha;
SkXfermode::Mode mode;
@@ -610,7 +620,9 @@ void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) {
GLuint textureUnit = 0;
glActiveTexture(gTextureUnits[textureUnit]);
- PathTexture* texture = mPathCache.get(path, paint);
+ const PathTexture* texture = mPathCache.get(path, paint);
+ if (!texture) return;
+ const AutoTexture autoCleanup(texture);
int alpha;
SkXfermode::Mode mode;