16#include <initializer_list>
37 float l=10, t=2000, r=100,
b=2064;
38 SkRect viewportRect{l, t, r,
b};
39 float valuesL[4] = {l-20, l-10, l+10, l+20};
40 float valuesT[4] = {t-20, t-10, t+10, t+20};
41 float valuesR[4] = {r+20, r+10, r-10, r-20};
42 float valuesB[4] = {
b+20,
b+10,
b-10,
b-20};
47 for (
const float*
y : {valuesT, valuesB}) {
48 for (
const float*
x : {valuesL, valuesR}) {
49 for (
int i = 0;
i < 500; ++
i) {
50 int mask = rand.
nextU();
51 const SkPoint devPts[4] = {{
x[(mask >> 0) & 3],
y[(mask >> 2) & 3]},
52 {
x[(mask >> 4) & 3],
y[(mask >> 6) & 3]},
53 {
x[(mask >> 8) & 3],
y[(mask >> 10) & 3]},
54 {
x[(mask >> 12) & 3],
y[(mask >> 14) & 3]}};
61 viewportRect.contains(devPts[0].
fX, devPts[0].
fY));
68 devBounds3.
outset(1e-3f, 1e-3f);
70 cullTest.
areVisible3(localPts) == viewportRect.intersects(devBounds3));
78 devBounds4.
outset(1e-3f, 1e-3f);
80 cullTest.
areVisible4(localPts) == viewportRect.intersects(devBounds4));
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
#define REPORTER_ASSERT(r, cond,...)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static const SkMatrix & I()
bool isVisible(SkPoint p) const
bool areVisible3(const SkPoint p[3]) const
bool areVisible4(const SkPoint p[4]) const
const SkMatrix gMatrices[]
DEF_TEST(CullTestTest, reporter)
void outset(float dx, float dy)
void setBounds(const SkPoint pts[], int count)