From fdd6fc1beb5076a630c7066b8b1731995636c09f Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 27 Apr 2012 11:47:13 -0700 Subject: Work-around for a Skia rasterization bug Bug #6411457 Skia does not generates the bottom right pixel of a rect when drawing a rect as an SkPath into an alpha8 bitmap. Change-Id: Ifb5286ae67745c9e44ee387b6d6ad607a9a2e6ce --- libs/hwui/PathCache.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libs/hwui/PathCache.cpp') diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp index e363b73498df..71a4ed7966ed 100644 --- a/libs/hwui/PathCache.cpp +++ b/libs/hwui/PathCache.cpp @@ -25,10 +25,15 @@ namespace android { namespace uirenderer { // Defined in ShapeCache.h -void computePathBounds(const SkPath *path, const SkPaint* paint, + +void computePathBounds(const SkPath* path, const SkPaint* paint, float& left, float& top, float& offset, uint32_t& width, uint32_t& height) { const SkRect& bounds = path->getBounds(); + computeBounds(bounds, paint, left, top, offset, width, height); +} +void computeBounds(const SkRect& bounds, const SkPaint* paint, + float& left, float& top, float& offset, uint32_t& width, uint32_t& height) { const float pathWidth = fmax(bounds.width(), 1.0f); const float pathHeight = fmax(bounds.height(), 1.0f); -- cgit v1.2.3-59-g8ed1b