aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkEdgeBuilder.h
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-18 16:09:51 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-18 16:09:51 +0000
commit909994fbae0ffb532f42feac8859f8d86bbf64de (patch)
tree8fa0989863618109ed9f17c25b949d68f63bf541 /src/core/SkEdgeBuilder.h
parentbb13586591bd412a0372aeb85d44159d2fa3f947 (diff)
new scanconversion technique
This technique geometrically clips all segments against the clip bounds, ensuring that we never send a value to the edgelist that might overflow in fixedpoint. Current disabled in SkScan_Path.cpp by a #define. There are a few minor pixel differences between this and the old technique, as found by the gm tool, so at the moment this new code is off by default. git-svn-id: http://skia.googlecode.com/svn/trunk@432 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkEdgeBuilder.h')
-rw-r--r--src/core/SkEdgeBuilder.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/SkEdgeBuilder.h b/src/core/SkEdgeBuilder.h
new file mode 100644
index 0000000000..e9ed51963b
--- /dev/null
+++ b/src/core/SkEdgeBuilder.h
@@ -0,0 +1,31 @@
+#ifndef SkEdgeBuilder_DEFINED
+#define SkEdgeBuilder_DEFINED
+
+#include "SkChunkAlloc.h"
+#include "SkRect.h"
+#include "SkTDArray.h"
+
+class SkEdge;
+class SkEdgeClipper;
+class SkPath;
+
+class SkEdgeBuilder {
+public:
+ SkEdgeBuilder();
+
+ int build(const SkPath& path, const SkIRect* clip, int shiftUp);
+
+ SkEdge** edgeList() { return fList.begin(); }
+
+private:
+ SkChunkAlloc fAlloc;
+ SkTDArray<SkEdge*> fList;
+ int fShiftUp;
+
+ void addLine(const SkPoint pts[]);
+ void addQuad(const SkPoint pts[]);
+ void addCubic(const SkPoint pts[]);
+ void addClipper(SkEdgeClipper*);
+};
+
+#endif