summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-06-17 15:49:22 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-17 15:49:22 -0700
commitee452bcc06c6a42ecc78a154bb4fb9366e9178eb (patch)
tree797463b97d578cb4ba54625bd98b7a90567246c6 /libs
parent405efeeeab6c1c0a76f6903881fdea0ee0b58259 (diff)
parent98029c825b9234e6b90721d910cc180885fcab1d (diff)
downloadframeworks_base-ee452bcc06c6a42ecc78a154bb4fb9366e9178eb.zip
frameworks_base-ee452bcc06c6a42ecc78a154bb4fb9366e9178eb.tar.gz
frameworks_base-ee452bcc06c6a42ecc78a154bb4fb9366e9178eb.tar.bz2
Merge "Fix rendering issue with paths when the stroke width is 0"
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/ShapeCache.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h
index b5cc29c..b048469 100644
--- a/libs/hwui/ShapeCache.h
+++ b/libs/hwui/ShapeCache.h
@@ -537,15 +537,16 @@ PathTexture* ShapeCache<Entry>::addTexture(const Entry& entry, const SkPath *pat
const float pathWidth = fmax(bounds.width(), 1.0f);
const float pathHeight = fmax(bounds.height(), 1.0f);
- if (pathWidth > mMaxTextureSize || pathHeight > mMaxTextureSize) {
- LOGW("Shape %s too large to be rendered into a texture", mName);
- return NULL;
- }
+ const float offset = fmax(paint->getStrokeWidth(), 1.0f) * 1.5f;
- const float offset = paint->getStrokeWidth() * 1.5f;
const uint32_t width = uint32_t(pathWidth + offset * 2.0 + 0.5);
const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5);
+ if (width > mMaxTextureSize || height > mMaxTextureSize) {
+ LOGW("Shape %s too large to be rendered into a texture", mName);
+ return NULL;
+ }
+
const uint32_t size = width * height;
// Don't even try to cache a bitmap that's bigger than the cache
if (size < mMaxSize) {