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

Side by Side Diff: src/pathops/SkOpSegment.cpp

Issue 14371011: path ops : add support for inverse fill (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
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 #include "SkIntersections.h" 7 #include "SkIntersections.h"
8 #include "SkOpSegment.h" 8 #include "SkOpSegment.h"
9 #include "SkPathWriter.h" 9 #include "SkPathWriter.h"
10 #include "TSearch.h" 10 #include "TSearch.h"
11 11
12 #define F (false) // discard the edge 12 #define F (false) // discard the edge
13 #define T (true) // keep the edge 13 #define T (true) // keep the edge
14 14
15 static const bool gUnaryActiveEdge[2][2] = { 15 static const bool gUnaryActiveEdge[2][2] = {
16 // from=0 from=1 16 // from=0 from=1
17 // to=0,1 to=0,1 17 // to=0,1 to=0,1
18 {F, T}, {T, F}, 18 {F, T}, {T, F},
19 }; 19 };
20 20
21 // FIXME: add support for kReverseDifference_Op
22 static const bool gActiveEdge[kXOR_PathOp + 1][2][2][2][2] = { 21 static const bool gActiveEdge[kXOR_PathOp + 1][2][2][2][2] = {
23 // miFrom=0 miFrom=1 22 // miFrom=0 miFrom=1
24 // miTo=0 miTo=1 miTo=0 miTo=1 23 // miTo=0 miTo=1 miTo=0 miTo=1
25 // suFrom=0 1 suFrom=0 1 suFrom=0 1 suFrom=0 1 24 // suFrom=0 1 suFrom=0 1 suFrom=0 1 suFrom=0 1
26 // suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 25 // suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1 suTo=0,1
27 {{{{F, F}, {F, F}}, {{T, F}, {T, F}}}, {{{T, T}, {F, F}}, {{F, T}, {T, F}}}} , // mi - su 26 {{{{F, F}, {F, F}}, {{T, F}, {T, F}}}, {{{T, T}, {F, F}}, {{F, T}, {T, F}}}} , // mi - su
28 {{{{F, F}, {F, F}}, {{F, T}, {F, T}}}, {{{F, F}, {T, T}}, {{F, T}, {T, F}}}} , // mi & su 27 {{{{F, F}, {F, F}}, {{F, T}, {F, T}}}, {{{F, F}, {T, T}}, {{F, T}, {T, F}}}} , // mi & su
29 {{{{F, T}, {T, F}}, {{T, T}, {F, F}}}, {{{T, F}, {T, F}}, {{F, F}, {F, F}}}} , // mi | su 28 {{{{F, T}, {T, F}}, {{T, T}, {F, F}}}, {{{T, F}, {T, F}}, {{F, F}, {F, F}}}} , // mi | su
30 {{{{F, T}, {T, F}}, {{T, F}, {F, T}}}, {{{T, F}, {F, T}}, {{F, T}, {T, F}}}} , // mi ^ su 29 {{{{F, T}, {T, F}}, {{T, F}, {F, T}}}, {{{T, F}, {F, T}}, {{F, T}, {T, F}}}} , // mi ^ su
31 }; 30 };
(...skipping 2759 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 sum += fTs[i].fWindValue; 2790 sum += fTs[i].fWindValue;
2792 slots[fTs[i].fOther->fID - 1] = as_digit(fTs[i].fWindValue); 2791 slots[fTs[i].fOther->fID - 1] = as_digit(fTs[i].fWindValue);
2793 sum += fTs[i].fOppValue; 2792 sum += fTs[i].fOppValue;
2794 slots[slotCount + fTs[i].fOther->fID - 1] = as_digit(fTs[i].fOppValue); 2793 slots[slotCount + fTs[i].fOther->fID - 1] = as_digit(fTs[i].fOppValue);
2795 } 2794 }
2796 SkDebugf("%s id=%2d %.*s | %.*s\n", __FUNCTION__, fID, slotCount, slots.begi n(), slotCount, 2795 SkDebugf("%s id=%2d %.*s | %.*s\n", __FUNCTION__, fID, slotCount, slots.begi n(), slotCount,
2797 slots.begin() + slotCount); 2796 slots.begin() + slotCount);
2798 return sum; 2797 return sum;
2799 } 2798 }
2800 #endif 2799 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698