blob: ae21f05b3115067d01f74a47f376708b259a4154 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
reed@android.com909994f2009-11-18 16:09:51 +00008#ifndef SkEdgeBuilder_DEFINED
9#define SkEdgeBuilder_DEFINED
10
11#include "SkChunkAlloc.h"
12#include "SkRect.h"
13#include "SkTDArray.h"
14
senorblanco@chromium.orgb1501a32009-12-04 19:53:28 +000015struct SkEdge;
reed@android.com909994f2009-11-18 16:09:51 +000016class SkEdgeClipper;
17class SkPath;
18
19class SkEdgeBuilder {
20public:
21 SkEdgeBuilder();
22
23 int build(const SkPath& path, const SkIRect* clip, int shiftUp);
24
25 SkEdge** edgeList() { return fList.begin(); }
26
27private:
28 SkChunkAlloc fAlloc;
29 SkTDArray<SkEdge*> fList;
30 int fShiftUp;
31
32 void addLine(const SkPoint pts[]);
33 void addQuad(const SkPoint pts[]);
34 void addCubic(const SkPoint pts[]);
35 void addClipper(SkEdgeClipper*);
36};
37
38#endif