blob: 287bfd12d4f87a197adb61f4da61140c3cddcbfd [file] [log] [blame]
caryclark45fa4472015-01-16 07:04:10 -08001/*
2 * Copyright 2013 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 SkOpCoincidence_DEFINED
8#define SkOpCoincidence_DEFINED
9
10#include "SkOpTAllocator.h"
11#include "SkOpSpan.h"
12
13class SkOpPtT;
14
15struct SkCoincidentSpans {
16 SkCoincidentSpans* fNext;
17 SkOpPtT* fCoinPtTStart;
18 SkOpPtT* fCoinPtTEnd;
19 SkOpPtT* fOppPtTStart;
20 SkOpPtT* fOppPtTEnd;
21 bool fFlipped;
22};
23
24class SkOpCoincidence {
25public:
26 SkOpCoincidence()
27 : fHead(NULL) {
28 }
29
30 void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
31 SkOpPtT* oppPtTEnd, bool flipped, SkChunkAlloc* allocator);
32 void apply();
33 bool contains(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
34 SkOpPtT* oppPtTEnd, bool flipped);
35 void dump() const;
36 void mark();
37
38 SkCoincidentSpans* fHead;
39};
40
41#endif