summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PathTessellator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/PathTessellator.cpp')
-rw-r--r--libs/hwui/PathTessellator.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp
index 9f7dd50..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>
@@ -229,7 +230,6 @@ void getStrokeVerticesFromPerimeter(const PaintInfo& paintInfo, const Vector<Ver
current->x - totalOffset.x,
current->y - totalOffset.y);
- last = current;
current = next;
lastNormal = nextNormal;
}
@@ -372,7 +372,6 @@ void getFillVerticesFromPerimeterAA(const PaintInfo& paintInfo, const Vector<Ver
current->y - totalOffset.y,
maxAlpha);
- last = current;
current = next;
lastNormal = nextNormal;
}
@@ -700,7 +699,6 @@ void getStrokeVerticesFromPerimeterAA(const PaintInfo& paintInfo, const Vector<V
current->y - outerOffset.y,
0.0f);
- last = current;
current = next;
lastNormal = nextNormal;
}
@@ -786,6 +784,7 @@ void PathTessellator::tessellatePath(const SkPath &path, const SkPaint* paint,
Rect bounds(path.getBounds());
paintInfo.expandBoundsForStroke(&bounds);
vertexBuffer.setBounds(bounds);
+ vertexBuffer.setMeshFeatureFlags(paintInfo.isAA ? VertexBuffer::kAlpha : VertexBuffer::kNone);
}
template <class TYPE>
@@ -843,6 +842,7 @@ void PathTessellator::tessellatePoints(const float* points, int count, const SkP
// expand bounds from vertex coords to pixel data
paintInfo.expandBoundsForStroke(&bounds);
vertexBuffer.setBounds(bounds);
+ vertexBuffer.setMeshFeatureFlags(paintInfo.isAA ? VertexBuffer::kAlpha : VertexBuffer::kNone);
}
void PathTessellator::tessellateLines(const float* points, int count, const SkPaint* paint,
@@ -893,6 +893,7 @@ void PathTessellator::tessellateLines(const float* points, int count, const SkPa
// expand bounds from vertex coords to pixel data
paintInfo.expandBoundsForStroke(&bounds);
vertexBuffer.setBounds(bounds);
+ vertexBuffer.setMeshFeatureFlags(paintInfo.isAA ? VertexBuffer::kAlpha : VertexBuffer::kNone);
}
///////////////////////////////////////////////////////////////////////////////
@@ -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;
}