epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 1 | |
| 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.com | 909994f | 2009-11-18 16:09:51 +0000 | [diff] [blame] | 8 | #ifndef SkEdgeBuilder_DEFINED |
| 9 | #define SkEdgeBuilder_DEFINED |
| 10 | |
| 11 | #include "SkChunkAlloc.h" |
| 12 | #include "SkRect.h" |
| 13 | #include "SkTDArray.h" |
| 14 | |
senorblanco@chromium.org | b1501a3 | 2009-12-04 19:53:28 +0000 | [diff] [blame] | 15 | struct SkEdge; |
reed@android.com | 909994f | 2009-11-18 16:09:51 +0000 | [diff] [blame] | 16 | class SkEdgeClipper; |
| 17 | class SkPath; |
| 18 | |
| 19 | class SkEdgeBuilder { |
| 20 | public: |
| 21 | SkEdgeBuilder(); |
| 22 | |
| 23 | int build(const SkPath& path, const SkIRect* clip, int shiftUp); |
| 24 | |
| 25 | SkEdge** edgeList() { return fList.begin(); } |
| 26 | |
| 27 | private: |
| 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 |