5 #include "flutter/testing/testing.h"
6 #include "gtest/gtest.h"
14 TEST(EntityPassClipStackTest, CanPushAndPopEntities) {
22 Matrix(), {0, 0}, 0, 100,
true);
28 Matrix(), {0, 0}, 2, 100,
true);
48 TEST(EntityPassClipStackTest, CanPopEntitiesSafely) {
58 TEST(EntityPassClipStackTest, AppendAndRestoreClipCoverage) {
68 Matrix(), {0, 0}, 0, 100,
true);
88 TEST(EntityPassClipStackTest, AppendAndRestoreClipCoverageNonAA) {
98 Matrix(), {0, 0}, 0, 100,
false);
120 TEST(EntityPassClipStackTest, AppendLargerClipCoverage) {
130 Matrix(), {0, 0}, 0, 100,
true);
138 Matrix(), {0, 0}, 1, 100,
true);
147 AppendLargerClipCoverageWithDifferenceOrNonSquare) {
157 Matrix(), {0, 0}, 0, 100,
true);
165 Matrix(), {0, 0}, 0, 100,
true);
171 TEST(EntityPassClipStackTest, AppendDecreasingSizeClipCoverage) {
180 for (
auto i = 1; i < 20; i++) {
184 Matrix(), {0, 0}, 0, 100,
true);
193 TEST(EntityPassClipStackTest, AppendIncreasingSizeClipCoverage) {
201 for (
auto i = 1; i < 20; i++) {
205 Matrix(), {0, 0}, 0, 100,
true);
213 TEST(EntityPassClipStackTest, UnbalancedRestore) {
232 TEST(EntityPassClipStackTest, ClipAndRestoreWithSubpasses) {
243 Matrix(), {0, 0}, 0, 100,
true);
265 Matrix(), {0, 0}, 0, 100,
true);
281 TEST(EntityPassClipStackTest, ClipAndRestoreWithSubpassesNonAA) {
292 Matrix(), {0, 0}, 0, 100,
false);
314 Matrix(), {0, 0}, 0, 100,
false);
A class that tracks all clips that have been recorded in the current entity pass stencil.
std::optional< Rect > CurrentClipCoverage() const
void PushSubpass(std::optional< Rect > subpass_coverage, size_t clip_height)
const std::vector< ReplayResult > & GetReplayEntities() const
ClipStateResult RecordClip(const ClipContents &clip_contents, Matrix transform, Point global_pass_position, uint32_t clip_depth, size_t clip_height_floor, bool is_aa)
ClipStateResult RecordRestore(Point global_pass_position, size_t restore_height)
const std::vector< ClipCoverageLayer > GetClipCoverageLayers() const
TEST(AllocationSizeTest, CanCreateTypedAllocations)
A 4x4 matrix using column-major storage.
constexpr static TRect MakeSize(const TSize< U > &size)
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
static constexpr TSize MakeWH(Type width, Type height)