Enforce maximum texture size.
When an app tries to render a bitmap or path larger than the GPU's maximum
texture size, the drawing command is ignored and a warning is logged. This
change also makes texture drawing more robust by catching potential errors
during texture creation.
This change also fixes a crash in the FontRenderer. The destructor would
sometimes try to free an uninitialized array.
Change-Id: I95ae0939c52192d97b340aa02417bf6d0c962c57
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index aeda416..59fa0a7 100644
--- a/libs/hwui/GradientCache.cpp
+++ b/libs/hwui/GradientCache.cpp
@@ -80,8 +80,7 @@
///////////////////////////////////////////////////////////////////////////////
Texture* GradientCache::get(SkShader* shader) {
- Texture* texture = mCache.get(shader);
- return texture;
+ return mCache.get(shader);
}
void GradientCache::remove(SkShader* shader) {