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

Side by Side Diff: src/core/SkEdgeBuilder.h

Issue 1654433002: combine vertical overlapping edges (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | src/core/SkEdgeBuilder.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkEdgeBuilder_DEFINED 8 #ifndef SkEdgeBuilder_DEFINED
9 #define SkEdgeBuilder_DEFINED 9 #define SkEdgeBuilder_DEFINED
10 10
11 #include "SkChunkAlloc.h" 11 #include "SkChunkAlloc.h"
12 #include "SkRect.h" 12 #include "SkRect.h"
13 #include "SkTDArray.h" 13 #include "SkTDArray.h"
14 14
15 struct SkEdge; 15 struct SkEdge;
16 class SkEdgeClipper; 16 class SkEdgeClipper;
17 class SkPath; 17 class SkPath;
18 18
19 class SkEdgeBuilder { 19 class SkEdgeBuilder {
20 public: 20 public:
21 SkEdgeBuilder(); 21 SkEdgeBuilder();
22 22
23 // returns the number of built edges. The array of those edge pointers 23 // returns the number of built edges. The array of those edge pointers
24 // is returned from edgeList(). 24 // is returned from edgeList().
25 int build(const SkPath& path, const SkIRect* clip, int shiftUp, bool clipToT heRight); 25 int build(const SkPath& path, const SkIRect* clip, int shiftUp, bool clipToT heRight);
26 26
27 SkEdge** edgeList() { return fEdgeList; } 27 SkEdge** edgeList() { return fEdgeList; }
28 28
29 private: 29 private:
30 enum Combine {
31 kNo_Combine,
32 kPartial_Combine,
33 kTotal_Combine
34 };
35
36 static Combine CombineVertical(const SkEdge* edge, SkEdge* last);
37 Combine checkVertical(const SkEdge* edge, SkEdge** edgePtr);
38
30 SkChunkAlloc fAlloc; 39 SkChunkAlloc fAlloc;
31 SkTDArray<SkEdge*> fList; 40 SkTDArray<SkEdge*> fList;
32 41
33 /* 42 /*
34 * If we're in general mode, we allcoate the pointers in fList, and this 43 * If we're in general mode, we allcoate the pointers in fList, and this
35 * will point at fList.begin(). If we're in polygon mode, fList will be 44 * will point at fList.begin(). If we're in polygon mode, fList will be
36 * empty, as we will have preallocated room for the pointers in fAlloc's 45 * empty, as we will have preallocated room for the pointers in fAlloc's
37 * block, and fEdgeList will point into that. 46 * block, and fEdgeList will point into that.
38 */ 47 */
39 SkEdge** fEdgeList; 48 SkEdge** fEdgeList;
40 49
41 int fShiftUp; 50 int fShiftUp;
42 51
43 public: 52 public:
44 void addLine(const SkPoint pts[]); 53 void addLine(const SkPoint pts[]);
45 void addQuad(const SkPoint pts[]); 54 void addQuad(const SkPoint pts[]);
46 void addCubic(const SkPoint pts[]); 55 void addCubic(const SkPoint pts[]);
47 void addClipper(SkEdgeClipper*); 56 void addClipper(SkEdgeClipper*);
48 57
49 int buildPoly(const SkPath& path, const SkIRect* clip, int shiftUp, bool cli pToTheRight); 58 int buildPoly(const SkPath& path, const SkIRect* clip, int shiftUp, bool cli pToTheRight);
50 }; 59 };
51 60
52 #endif 61 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkEdgeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698