From b0772a6cc5ab09eb40cbb1fd6c7e0293ae3d2efe Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Mon, 16 Mar 2015 14:35:55 -0400 Subject: [PATCH] Add conic support to HWUI path tessellator. bug: 19732872 Change-Id: Ic3ae46f746325468ab972c9daf829099165eb596 --- libs/hwui/PathTessellator.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp index 3d8a7491a434b..c1f61d696b006 100644 --- a/libs/hwui/PathTessellator.cpp +++ b/libs/hwui/PathTessellator.cpp @@ -37,6 +37,7 @@ #include #include +#include // WARNING: Internal Skia Header #include #include @@ -951,6 +952,21 @@ bool PathTessellator::approximatePathOutlineVertices(const SkPath& path, bool fo pts[2].x(), pts[2].y(), sqrInvScaleX, sqrInvScaleY, thresholdSquared, outputVertices); break; + case SkPath::kConic_Verb: { + ALOGV("kConic_Verb"); + SkAutoConicToQuads converter; + const SkPoint* quads = converter.computeQuads(pts, iter.conicWeight(), + thresholdSquared); + for (int i = 0; i < converter.countQuads(); ++i) { + const int offset = 2 * i; + recursiveQuadraticBezierVertices( + quads[offset].x(), quads[offset].y(), + quads[offset+2].x(), quads[offset+2].y(), + quads[offset+1].x(), quads[offset+1].y(), + sqrInvScaleX, sqrInvScaleY, thresholdSquared, outputVertices); + } + break; + } default: break; }