Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1802)

Side by Side Diff: src/pathops/SkOpEdgeBuilder.h

Issue 13094010: Add implementation of path ops (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkOpContour.cpp ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7 #ifndef SkOpEdgeBuilder_DEFINED
8 #define SkOpEdgeBuilder_DEFINED
9
10 #include "SkOpContour.h"
11 #include "SkPathWriter.h"
12 #include "SkTDArray.h"
13 #include "SkTArray.h"
14
15 class SkOpEdgeBuilder {
16 public:
17 SkOpEdgeBuilder(const SkPathWriter& path, SkTArray<SkOpContour>& contours)
18 : fPath(path.nativePath())
19 , fContours(contours)
20 {
21 init();
22 }
23
24 SkOpEdgeBuilder(const SkPath& path, SkTArray<SkOpContour>& contours)
25 : fPath(&path)
26 , fContours(contours)
27 {
28 init();
29 }
30
31 void complete() {
32 if (fCurrentContour && fCurrentContour->segments().count()) {
33 fCurrentContour->complete();
34 fCurrentContour = NULL;
35 }
36 }
37
38 SkPathOpsMask xorMask() const {
39 return fXorMask[fOperand];
40 }
41
42 void addOperand(const SkPath& path);
43 void finish();
44 void init();
45
46 private:
47 int preFetch();
48 void walk();
49
50 const SkPath* fPath;
51 SkTDArray<SkPoint> fPathPts; // FIXME: point directly to path pts instead
52 SkTDArray<uint8_t> fPathVerbs; // FIXME: remove
53 SkOpContour* fCurrentContour;
54 SkTArray<SkOpContour>& fContours;
55 SkTDArray<SkPoint> fReducePts; // segments created on the fly
56 SkTDArray<int> fExtra; // -1 marks new contour, > 0 offsets into contour
57 SkPathOpsMask fXorMask[2];
58 int fSecondHalf;
59 bool fOperand;
60 };
61
62 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkOpContour.cpp ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698