summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PathTessellator.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2015-03-16 14:35:55 -0400
committerDerek Sollenberger <djsollen@google.com>2015-03-16 15:28:16 -0400
commitb0772a6cc5ab09eb40cbb1fd6c7e0293ae3d2efe (patch)
treec54f01c945d768c13edcd5e6bccd5b435489f237 /libs/hwui/PathTessellator.cpp
parent592f8808951a292848a815a8b84df7e1b425d11f (diff)
downloadframeworks_base-b0772a6cc5ab09eb40cbb1fd6c7e0293ae3d2efe.zip
frameworks_base-b0772a6cc5ab09eb40cbb1fd6c7e0293ae3d2efe.tar.gz
frameworks_base-b0772a6cc5ab09eb40cbb1fd6c7e0293ae3d2efe.tar.bz2
Add conic support to HWUI path tessellator.
bug: 19732872 Change-Id: Ic3ae46f746325468ab972c9daf829099165eb596
Diffstat (limited to 'libs/hwui/PathTessellator.cpp')
-rw-r--r--libs/hwui/PathTessellator.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp
index 3d8a749..c1f61d6 100644
--- a/libs/hwui/PathTessellator.cpp
+++ b/libs/hwui/PathTessellator.cpp
@@ -37,6 +37,7 @@
#include <SkPath.h>
#include <SkPaint.h>
+#include <SkGeometry.h> // WARNING: Internal Skia Header
#include <stdlib.h>
#include <stdint.h>
@@ -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;
}