Lines Matching defs:path
37 void tessellate_shadow(skiatest::Reporter* reporter, const SkPath& path, const SkMatrix& ctm,
40 auto verts = SkShadowTessellator::MakeAmbient(path, ctm, heightParams, true);
43 verts = SkShadowTessellator::MakeAmbient(path, ctm, heightParams, false);
46 verts = SkShadowTessellator::MakeSpot(path, ctm, heightParams, {0, 0, 128}, 128.f, true, false);
49 verts = SkShadowTessellator::MakeSpot(path, ctm, heightParams, {0, 0, 128}, 128.f, false,
53 verts = SkShadowTessellator::MakeSpot(path, ctm, heightParams, {0, 0, 128}, 128.f, true, true);
56 verts = SkShadowTessellator::MakeSpot(path, ctm, heightParams, {0, 0, 128}, 128.f, false, true);
63 SkPath path;
64 path.cubicTo(100, 50, 20, 100, 0, 0);
65 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 4}, kDo_ExpectVerts, true);
66 // super high path
67 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 4.0e+37f},
71 path.reset();
72 path.lineTo(10.f, 10.f);
73 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 4}, kDont_ExpectVerts, true);
76 path.reset();
78 path.lineTo((SkScalar)i, (SkScalar)i);
80 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 4}, kDont_ExpectVerts, true);
82 // ugly degenerate path
83 path.reset();
84 path.moveTo(-134217728, 2.22265153e+21f);
85 path.cubicTo(-2.33326106e+21f, 7.36298265e-41f, 3.72237738e-22f, 5.99502692e-36f,
87 path.cubicTo(1.03397626e-25f, 5.99502692e-36f, 9.18354962e-41f, 0, 4.6142745e-37f, -213558848);
88 path.lineTo(-134217728, 2.2226515e+21f);
89 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 9}, kDont_ExpectVerts, true);
91 // simple concave path (star of David)
92 path.reset();
93 path.moveTo(0.0f, -50.0f);
94 path.lineTo(14.43f, -25.0f);
95 path.lineTo(43.30f, -25.0f);
96 path.lineTo(28.86f, 0.0f);
97 path.lineTo(43.30f, 25.0f);
98 path.lineTo(14.43f, 25.0f);
99 path.lineTo(0.0f, 50.0f);
100 path.lineTo(-14.43f, 25.0f);
101 path.lineTo(-43.30f, 25.0f);
102 path.lineTo(-28.86f, 0.0f);
103 path.lineTo(-43.30f, -25.0f);
104 path.lineTo(-14.43f, -25.0f);
106 // tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 9}, kDo_ExpectVerts, true);
108 // complex concave path (bowtie)
109 path.reset();
110 path.moveTo(-50, -50);
111 path.lineTo(-50, 50);
112 path.lineTo(50, -50);
113 path.lineTo(50, 50);
114 path.lineTo(-50, -50);
115 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 9}, kDont_ExpectVerts, false);
117 // multiple contour path
118 path.close();
119 path.moveTo(0, 0);
120 path.lineTo(1, 0);
121 path.lineTo(0, 1);
122 tessellate_shadow(reporter, path, canvas.getTotalMatrix(), {0, 0, 9}, kDont_ExpectVerts, false);
125 void check_xformed_bounds(skiatest::Reporter* reporter, const SkPath& path, const SkMatrix& ctm) {
136 SkDrawShadowMetrics::GetLocalBounds(path, rec, ctm, &bounds);
139 auto verts = SkShadowTessellator::MakeAmbient(path, ctm, rec.fZPlaneParams, true);
146 verts = SkShadowTessellator::MakeSpot(path, ctm, rec.fZPlaneParams, devLightPos,
155 SkDrawShadowMetrics::GetLocalBounds(path, rec, ctm, &bounds);
158 verts = SkShadowTessellator::MakeAmbient(path, ctm, rec.fZPlaneParams, true);
165 verts = SkShadowTessellator::MakeSpot(path, ctm, rec.fZPlaneParams, devLightPos,
172 void check_bounds(skiatest::Reporter* reporter, const SkPath& path) {
177 check_xformed_bounds(reporter, path, ctm);
179 check_xformed_bounds(reporter, path, ctm);
181 check_xformed_bounds(reporter, path, ctm);
183 check_xformed_bounds(reporter, path, ctm);
187 check_xformed_bounds(reporter, path, ctm);
190 check_xformed_bounds(reporter, path, ctm);
193 check_xformed_bounds(reporter, path, ctm);
198 SkPath path;
199 path.addRRect(SkRRect::MakeRectXY(SkRect::MakeLTRB(-50, -20, 40, 30), 4, 4));
200 check_bounds(reporter, path);
202 path.reset();
203 path.addOval(SkRect::MakeLTRB(300, 300, 900, 900));
204 check_bounds(reporter, path);
206 path.reset();
207 path.cubicTo(100, 50, 20, 100, 0, 0);
208 check_bounds(reporter, path);