13 auto firstElement =
eq->fQueue.begin();
16 Event event = *firstElement;
19 eq->fQueue.erase(firstElement);
33 Point eventPoint = {100, 100};
34 Segment s = {{100, 100}, {200, 200}};
36 Segment s0 = {{50, 50}, {150, 150}},
37 s1 = {{150, 50}, {50, 150}};
42 auto cursor = q.begin();
59 Point eventPoint = {100, 100};
60 q.insert({eventPoint,
Lower{} });
64 Event e = EventQueueTestingPeer::NextEvent(&
eq);
71 Point eventPoint = {100, 100};
72 q.insert({eventPoint,
Lower{}});
73 q.insert({eventPoint,
Lower{}});
78 auto [
p, _] = EventQueueTestingPeer::NextEvent(&
eq);
85 Point eventPoint1 = {100, 100};
86 Point eventPoint2 = {100, 101};
88 q.insert({eventPoint1,
Lower{}});
89 q.insert({eventPoint2,
Lower{}});
94 auto [
p, _] = EventQueueTestingPeer::NextEvent(&
eq);
100 auto [
p, _] = EventQueueTestingPeer::NextEvent(&
eq);
107 Segment s0 {{0, 0}, {100, 100}};
108 Segment s1 {{0, 0}, {-100, 100}};
114 Event e = EventQueueTestingPeer::NextEvent(&
eq);
118 Upper upper = std::get<Upper>(
e.type);
120 Event e2 = EventQueueTestingPeer::NextEvent(&
eq);
178 auto [s0, s1, pt] = crossing;
179 queue->addCrossing(pt, s0, s1);
194 static constexpr Point eventPoint = {100, 100};
195 static constexpr Point endPoint = {200, 200};
196 static constexpr Segment s = {eventPoint, endPoint};
204 eq.handleNextEventPoint(&eh1);
207 eq.handleNextEventPoint(&eh2);
214 static constexpr Point b0 = {100, 100};
215 static constexpr Point e0 = {200, 200};
217 static constexpr Point b1 = {200, 100};
218 static constexpr Point e1 = {100, 200};
220 static constexpr Point crossingPoint = {150, 150};
230 eq.handleNextEventPoint(&eh1);
233 eq.handleNextEventPoint(&eh2);
236 eq.handleNextEventPoint(&eh3);
239 eq.handleNextEventPoint(&eh4);
242 eq.handleNextEventPoint(&eh5);
DEF_TEST(BO_EventQueueOrdering, reporter)
static bool eq(const SkM44 &a, const SkM44 &b, float tol)
#define REPORTER_ASSERT(r, cond,...)
static Event NextEvent(EventQueue *eq)
static const char * begin(const StringSlice &s)
std::set< Segment, OrderBySlope > InsertionSegmentSet
std::set< Segment > DeletionSegmentSet
void handleDeletions(Point eventPoint, const DeletionSegmentSet &removing) override
TestEventHandler(skiatest::Reporter *r, Point eventPoint, SkSpan< const Segment > deletions, SkSpan< const Segment > insertions, SkSpan< const Crossing > crossings, HasDeletions hasDeletions=kHasDeletions)
std::vector< Crossing > fCrossings
std::vector< Segment > fInsertions
const Point fCandidateEventPoint
std::vector< Segment > fDeletions
skiatest::Reporter *const fR
const HasDeletions fHasDeletions
void handleInsertionsAndCheckForNewCrossings(Point eventPoint, const InsertionSegmentSet &inserting, EventQueueInterface *queue) override