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

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

Issue 2321973005: Rewriting path writer (Closed)
Patch Set: revert unneeded test changes Created 4 years, 3 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
« 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
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkOpEdgeBuilder_DEFINED 7 #ifndef SkOpEdgeBuilder_DEFINED
8 #define SkOpEdgeBuilder_DEFINED 8 #define SkOpEdgeBuilder_DEFINED
9 9
10 #include "SkOpContour.h" 10 #include "SkOpContour.h"
11 #include "SkPathWriter.h" 11 #include "SkPathWriter.h"
12 12
13 class SkOpEdgeBuilder { 13 class SkOpEdgeBuilder {
14 public: 14 public:
15 SkOpEdgeBuilder(const SkPathWriter& path, SkOpContour* contours2, SkOpGlobal State* globalState) 15 SkOpEdgeBuilder(const SkPathWriter& path, SkOpContourHead* contours2,
16 SkOpGlobalState* globalState)
16 : fGlobalState(globalState) 17 : fGlobalState(globalState)
17 , fPath(path.nativePath()) 18 , fPath(path.nativePath())
18 , fContoursHead(contours2) 19 , fContoursHead(contours2)
19 , fAllowOpenContours(true) { 20 , fAllowOpenContours(true) {
20 init(); 21 init();
21 } 22 }
22 23
23 SkOpEdgeBuilder(const SkPath& path, SkOpContour* contours2, SkOpGlobalState* globalState) 24 SkOpEdgeBuilder(const SkPath& path, SkOpContourHead* contours2, SkOpGlobalSt ate* globalState)
24 : fGlobalState(globalState) 25 : fGlobalState(globalState)
25 , fPath(&path) 26 , fPath(&path)
26 , fContoursHead(contours2) 27 , fContoursHead(contours2)
27 , fAllowOpenContours(false) { 28 , fAllowOpenContours(false) {
28 init(); 29 init();
29 } 30 }
30 31
31 void addOperand(const SkPath& path); 32 void addOperand(const SkPath& path);
32 33
33 void complete() { 34 void complete() {
34 if (fCurrentContour && fCurrentContour->count()) { 35 if (fCurrentContour && fCurrentContour->count()) {
35 fCurrentContour->complete(); 36 fCurrentContour->complete();
36 fCurrentContour = nullptr; 37 fCurrentContour = nullptr;
37 } 38 }
38 } 39 }
39 40
40 int count() const;
41 bool finish(); 41 bool finish();
42 42
43 const SkOpContour* head() const { 43 const SkOpContour* head() const {
44 return fContoursHead; 44 return fContoursHead;
45 } 45 }
46 46
47 void init(); 47 void init();
48 bool unparseable() const { return fUnparseable; } 48 bool unparseable() const { return fUnparseable; }
49 SkPathOpsMask xorMask() const { return fXorMask[fOperand]; } 49 SkPathOpsMask xorMask() const { return fXorMask[fOperand]; }
50 50
51 private: 51 private:
52 void closeContour(const SkPoint& curveEnd, const SkPoint& curveStart); 52 void closeContour(const SkPoint& curveEnd, const SkPoint& curveStart);
53 bool close(); 53 bool close();
54 int preFetch(); 54 int preFetch();
55 bool walk(); 55 bool walk();
56 56
57 SkOpGlobalState* fGlobalState; 57 SkOpGlobalState* fGlobalState;
58 const SkPath* fPath; 58 const SkPath* fPath;
59 SkTDArray<SkPoint> fPathPts; 59 SkTDArray<SkPoint> fPathPts;
60 SkTDArray<SkScalar> fWeights; 60 SkTDArray<SkScalar> fWeights;
61 SkTDArray<uint8_t> fPathVerbs; 61 SkTDArray<uint8_t> fPathVerbs;
62 SkOpContour* fCurrentContour; 62 SkOpContour* fCurrentContour;
63 SkOpContour* fContoursHead; 63 SkOpContourHead* fContoursHead;
64 SkPathOpsMask fXorMask[2]; 64 SkPathOpsMask fXorMask[2];
65 int fSecondHalf; 65 int fSecondHalf;
66 bool fOperand; 66 bool fOperand;
67 bool fAllowOpenContours; 67 bool fAllowOpenContours;
68 bool fUnparseable; 68 bool fUnparseable;
69 }; 69 };
70 70
71 #endif 71 #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