From d79991277043d6bdbd90bb63fd8aff73ef9e06a5 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 30 Sep 2010 16:56:56 -0700 Subject: [PATCH] Make simple paths made of lines work. Bug #3041098 Change-Id: Ife9c3f01ded10e2bb35b1cdf1a54734d8347fee4 --- graphics/java/android/graphics/Path.java | 2 ++ libs/hwui/PathCache.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/graphics/java/android/graphics/Path.java b/graphics/java/android/graphics/Path.java index c3416a01f5717..1324431e86ba2 100644 --- a/graphics/java/android/graphics/Path.java +++ b/graphics/java/android/graphics/Path.java @@ -236,6 +236,7 @@ public class Path { * @param y The y-coordinate of the end of a line */ public void lineTo(float x, float y) { + isSimplePath = false; native_lineTo(mNativePath, x, y); } @@ -250,6 +251,7 @@ public class Path { * this contour, to specify a line */ public void rLineTo(float dx, float dy) { + isSimplePath = false; native_rLineTo(mNativePath, dx, dy); } diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp index 70e06a1c3f797..377727b033e94 100644 --- a/libs/hwui/PathCache.cpp +++ b/libs/hwui/PathCache.cpp @@ -138,8 +138,8 @@ PathTexture* PathCache::addTexture(const PathCacheEntry& entry, const SkPath *path, const SkPaint* paint) { const SkRect& bounds = path->getBounds(); - const float pathWidth = bounds.width(); - const float pathHeight = bounds.height(); + const float pathWidth = fmax(bounds.width(), 1.0f); + const float pathHeight = fmax(bounds.height(), 1.0f); if (pathWidth > mMaxTextureSize || pathHeight > mMaxTextureSize) { LOGW("Path too large to be rendered into a texture");