7#include "flutter/testing/testing.h"
8#include "gtest/gtest.h"
16TEST(EntityPassClipStackTest, CanPushAndPopEntities) {
46TEST(EntityPassClipStackTest, CanPopEntitiesSafely) {
57TEST(EntityPassClipStackTest, CanAppendNoChange) {
69TEST(EntityPassClipStackTest, AppendCoverageNoChange) {
81 .coverage = std::nullopt,
83 entity, 0,
Point(0, 0));
85 EXPECT_FALSE(
result.clip_did_change);
92TEST(EntityPassClipStackTest, AppendAndRestoreClipCoverage) {
105 entity, 0,
Point(0, 0));
116 auto restore_clip = std::make_shared<ClipRestoreContents>();
117 restore_clip->SetRestoreHeight(0);
124 entity, 0,
Point(0, 0));
133TEST(EntityPassClipStackTest, UnbalancedRestore) {
141 auto restore_clip = std::make_shared<ClipRestoreContents>();
142 restore_clip->SetRestoreHeight(0);
149 entity, 0,
Point(0, 0));
150 EXPECT_FALSE(
result.should_render);
151 EXPECT_FALSE(
result.clip_did_change);
160TEST(EntityPassClipStackTest, ClipAndRestoreWithSubpasses) {
174 entity, 0,
Point(0, 0));
197 entity, 0,
Point(0, 0));
A class that tracks all clips that have been recorded in the current entity pass stencil.
void PushSubpass(std::optional< Rect > subpass_coverage, size_t clip_height)
const std::vector< ReplayResult > & GetReplayEntities() const
ClipStateResult ApplyClipState(Contents::ClipCoverage global_clip_coverage, Entity &entity, size_t clip_height_floor, Point global_pass_position)
Applies the current clip state to an Entity. If the given Entity is a clip operation,...
const std::vector< ClipCoverageLayer > GetClipCoverageLayers() const
void RecordEntity(const Entity &entity, Contents::ClipCoverage::Type type, std::optional< Rect > clip_coverage)
void SetContents(std::shared_ptr< Contents > contents)
TEST(AiksCanvasTest, EmptyCullRect)
static constexpr TRect MakeSize(const TSize< U > &size)
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
static constexpr TSize MakeWH(Type width, Type height)
#define EXPECT_TRUE(handle)