c0bd9f9fe5
Current strategy: everything from the top Things to look at first are the manual changes: - added tools/rewrite_includes.py - removed -Idirectives from BUILD.gn - various compile.sh simplifications - tweak tools/embed_resources.py - update gn/find_headers.py to write paths from the top - update gn/gn_to_bp.py SkUserConfig.h layout so that #include "include/config/SkUserConfig.h" always gets the header we want. No-Presubmit: true Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
105 lines
2.9 KiB
C++
105 lines
2.9 KiB
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 "tests/PathOpsQuadIntersectionTestData.h"
|
|
|
|
const QuadPts quadraticPoints[] = {
|
|
{{{0, 0}, {1, 0}, {0, 0}}},
|
|
{{{0, 0}, {0, 1}, {0, 0}}},
|
|
{{{0, 0}, {1, 1}, {0, 0}}},
|
|
{{{1, 1}, {2, 2}, {1, 1}}},
|
|
};
|
|
|
|
const size_t quadraticPoints_count = SK_ARRAY_COUNT(quadraticPoints);
|
|
|
|
const QuadPts quadraticLines[] = {
|
|
{{{0, 0}, {0, 0}, {1, 0}}},
|
|
{{{1, 0}, {0, 0}, {0, 0}}},
|
|
{{{1, 0}, {2, 0}, {3, 0}}},
|
|
{{{0, 0}, {0, 0}, {0, 1}}},
|
|
{{{0, 1}, {0, 0}, {0, 0}}},
|
|
{{{0, 1}, {0, 2}, {0, 3}}},
|
|
{{{0, 0}, {0, 0}, {1, 1}}},
|
|
{{{1, 1}, {0, 0}, {0, 0}}},
|
|
{{{1, 1}, {2, 2}, {3, 3}}},
|
|
{{{1, 1}, {3, 3}, {3, 3}}},
|
|
{{{1, 1}, {1, 1}, {2, 2}}},
|
|
{{{1, 1}, {1, 1}, {3, 3}}},
|
|
{{{1, 1}, {2, 2}, {4, 4}}}, // no coincident
|
|
{{{1, 1}, {3, 3}, {4, 4}}},
|
|
{{{1, 1}, {3, 3}, {2, 2}}},
|
|
{{{1, 1}, {4, 4}, {2, 2}}},
|
|
{{{1, 1}, {4, 4}, {3, 3}}},
|
|
{{{2, 2}, {1, 1}, {3, 3}}},
|
|
{{{2, 2}, {1, 1}, {4, 4}}},
|
|
{{{2, 2}, {3, 3}, {1, 1}}},
|
|
{{{2, 2}, {3, 3}, {4, 4}}},
|
|
{{{2, 2}, {4, 4}, {1, 1}}},
|
|
{{{2, 2}, {4, 4}, {3, 3}}},
|
|
};
|
|
|
|
const size_t quadraticLines_count = SK_ARRAY_COUNT(quadraticLines);
|
|
|
|
static const double F = FLT_EPSILON * 32;
|
|
static const double H = FLT_EPSILON * 32;
|
|
static const double J = FLT_EPSILON * 32;
|
|
static const double K = FLT_EPSILON * 32; // INVESTIGATE: why are larger multiples necessary?
|
|
|
|
const QuadPts quadraticModEpsilonLines[] = {
|
|
{{{0, F}, {0, 0}, {1, 0}}},
|
|
{{{0, 0}, {1, 0}, {0, F}}},
|
|
{{{1, 0}, {0, F}, {0, 0}}},
|
|
{{{1, H}, {2, 0}, {3, 0}}},
|
|
// {{{F, 0}, {0, 0}, {0, 1}}}, // INVESTIGATE: even substituting K for F, quad is still linear.
|
|
// {{{0, 0}, {0, 1}, {F, 0}}},
|
|
// {{{0, 1}, {F, 0}, {0, 0}}},
|
|
// {{{H, 1}, {0, 2}, {0, 3}}},
|
|
{{{0, F}, {0, 0}, {1, 1}}},
|
|
{{{0, 0}, {1, 1}, {F, 0}}},
|
|
{{{1, 1}, {F, 0}, {0, 0}}},
|
|
{{{1, 1+J}, {2, 2}, {3, 3}}},
|
|
{{{1, 1}, {3, 3}, {3+F, 3}}},
|
|
{{{1, 1}, {1+F, 1}, {2, 2}}},
|
|
{{{1, 1}, {2, 2}, {1, 1+K}}},
|
|
{{{1, 1}, {1, 1+F}, {3, 3}}},
|
|
{{{1+H, 1}, {2, 2}, {4, 4}}}, // no coincident
|
|
{{{1, 1+K}, {3, 3}, {4, 4}}},
|
|
{{{1, 1}, {3+F, 3}, {2, 2}}},
|
|
{{{1, 1}, {4, 4+F}, {2, 2}}},
|
|
{{{1, 1}, {4, 4}, {3+F, 3}}},
|
|
{{{2, 2}, {1, 1}, {3, 3+F}}},
|
|
{{{2+F, 2}, {1, 1}, {4, 4}}},
|
|
{{{2, 2+F}, {3, 3}, {1, 1}}},
|
|
{{{2, 2}, {3+F, 3}, {4, 4}}},
|
|
{{{2, 2}, {4, 4+F}, {1, 1}}},
|
|
{{{2, 2}, {4, 4}, {3+F, 3}}},
|
|
};
|
|
|
|
const size_t quadraticModEpsilonLines_count =
|
|
SK_ARRAY_COUNT(quadraticModEpsilonLines);
|
|
|
|
const QuadPts quadraticTests[][2] = {
|
|
{ // one intersection
|
|
{{{0, 0},
|
|
{0, 1},
|
|
{1, 1}}},
|
|
{{{0, 1},
|
|
{0, 0},
|
|
{1, 0}}}
|
|
},
|
|
{ // four intersections
|
|
{{{1, 0},
|
|
{2, 6},
|
|
{3, 0}}},
|
|
{{{0, 1},
|
|
{6, 2},
|
|
{0, 3}}}
|
|
}
|
|
};
|
|
|
|
const size_t quadraticTests_count = SK_ARRAY_COUNT(quadraticTests);
|