#include <CullTest.h>
Definition at line 26 of file CullTest.h.
◆ CullTest() [1/2]
skgpu::tess::CullTest::CullTest |
( |
| ) |
|
|
default |
◆ CullTest() [2/2]
skgpu::tess::CullTest::CullTest |
( |
const SkRect & |
devCullBounds, |
|
|
const SkMatrix & |
m |
|
) |
| |
|
inline |
Definition at line 30 of file CullTest.h.
30 {
31 this->
set(devCullBounds,
m);
32 }
void set(const SkRect &devCullBounds, const SkMatrix &m)
◆ areVisible3()
bool skgpu::tess::CullTest::areVisible3 |
( |
const SkPoint |
p[3] | ) |
const |
|
inline |
Definition at line 57 of file CullTest.h.
57 {
58
59 auto val0 = fMatY *
p[0].fY;
60 auto val1 = fMatY *
p[1].fY;
61 auto val2 = fMatY *
p[2].fY;
62 val0 = fMatX*
p[0].fX + val0;
63 val1 = fMatX*
p[1].fX + val1;
64 val2 = fMatX*
p[2].fX + val2;
65
66
67
68 val0 =
max(val0, val1);
69 val0 =
max(val0, val2);
70
71
72
73
74 return all(fCullBounds < val0);
75 }
static float max(float r, float g, float b)
SIT bool all(const Vec< 1, T > &x)
◆ areVisible4()
bool skgpu::tess::CullTest::areVisible4 |
( |
const SkPoint |
p[4] | ) |
const |
|
inline |
Definition at line 78 of file CullTest.h.
78 {
79
80 auto val0 = fMatY *
p[0].fY;
81 auto val1 = fMatY *
p[1].fY;
82 auto val2 = fMatY *
p[2].fY;
83 auto val3 = fMatY *
p[3].fY;
84 val0 = fMatX*
p[0].fX + val0;
85 val1 = fMatX*
p[1].fX + val1;
86 val2 = fMatX*
p[2].fX + val2;
87 val3 = fMatX*
p[3].fX + val3;
88
89
90
91 val0 =
max(val0, val1);
92 val2 =
max(val2, val3);
93 val0 =
max(val0, val2);
94
95
96
97
98 return all(fCullBounds < val0);
99 }
◆ isVisible()
bool skgpu::tess::CullTest::isVisible |
( |
SkPoint |
p | ) |
const |
|
inline |
Definition at line 49 of file CullTest.h.
49 {
50
51 auto devPt = fMatX*
p.fX + fMatY*
p.fY;
52
53 return all(fCullBounds < devPt);
54 }
◆ set()
void skgpu::tess::CullTest::set |
( |
const SkRect & |
devCullBounds, |
|
|
const SkMatrix & |
m |
|
) |
| |
|
inline |
Definition at line 34 of file CullTest.h.
34 {
36
37 fMatX = {
m.getScaleX(),
m.getSkewY(), -
m.getScaleX(), -
m.getSkewY()};
38 fMatY = {
m.getSkewX(),
m.getScaleY(), -
m.getSkewX(), -
m.getScaleY()};
39
40
41
42 fCullBounds = {devCullBounds.
fLeft -
m.getTranslateX(),
43 devCullBounds.
fTop -
m.getTranslateY(),
44 m.getTranslateX() - devCullBounds.
fRight,
45 m.getTranslateY() - devCullBounds.
fBottom};
46 }
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
SkScalar fTop
smaller y-axis bounds
The documentation for this class was generated from the following file: