624637cc8e
This replacement shoots axis-aligned rays through all intersecting edges to find the outermost one either horizontally or vertically. The resulting code is smaller and twice as fast. To support this, most of the horizontal / vertical intersection code was rewritten and standardized, and old code supporting the top-directed winding was deleted. Contours were pointed to by an SkTDArray. Instead, put them in a linked list, and designate the list head with its own class to ensure that methods that take lists of contours start at the top. This change removed a large percentage of memory allocations used by path ops. TBR=reed@google.com BUG=skia:3588 Review URL: https://codereview.chromium.org/1111333002
24 lines
717 B
C++
24 lines
717 B
C++
/*
|
|
* Copyright 2012 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
#include "PathOpsTestCommon.h"
|
|
#include "SkPathOpsCubic.h"
|
|
#include "Test.h"
|
|
|
|
static const SkDCubic hullTests[] = {
|
|
{{{2.6250000819563866, 2.3750000223517418}, {2.833333432674408, 2.3333333432674408}, {3.1111112236976624, 2.3333333134651184}, {3.4074075222015381, 2.3333332538604736}}},
|
|
};
|
|
|
|
static const size_t hullTests_count = SK_ARRAY_COUNT(hullTests);
|
|
|
|
DEF_TEST(PathOpsCubicHull, reporter) {
|
|
for (size_t index = 0; index < hullTests_count; ++index) {
|
|
const SkDCubic& cubic = hullTests[index];
|
|
char order[4];
|
|
cubic.convexHull(order);
|
|
}
|
|
}
|