#include "third_party/blink/renderer/platform/graphics/paint/raster_invalidator.h"
#include <utility>
#include "base/functional/function_ref.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_artifact.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/testing/paint_property_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/paint_test_configurations.h"
#include "third_party/blink/renderer/platform/testing/test_paint_artifact.h"
#include "ui/gfx/geometry/rect_conversions.h"
ElementsAre;
namespace blink {
static constexpr gfx::Vector2dF kDefaultLayerOffset(-9999, -7777);
static constexpr gfx::Size kDefaultLayerBounds(18888, 16666);
class RasterInvalidatorTest : public testing::Test,
public PaintTestConfigurations,
public RasterInvalidator::Callback { … };
INSTANTIATE_PAINT_TEST_SUITE_P(…);
MapFunction;
void MapNothing(gfx::Rect&) { … }
void PrintTo(MapFunction, std::ostream*) { … }
static gfx::Rect ChunkRectToLayer(const gfx::Rect& rect,
const gfx::Vector2dF& layer_offset,
MapFunction mapper = MapNothing) { … }
static bool CheckChunkInvalidation(
const RasterInvalidationInfo& info,
const PaintChunkSubset& chunks,
wtf_size_t index,
PaintInvalidationReason reason,
const gfx::Vector2dF& layer_offset,
const std::optional<gfx::Rect>& chunk_rect = std::nullopt,
MapFunction mapper = MapNothing) { … }
MATCHER_P5(ChunkInvalidation, chunks, index, reason, layer_offset, mapper, "") { … }
MATCHER_P4(ChunkInvalidation, chunks, index, reason, layer_offset, "") { … }
MATCHER_P3(ChunkInvalidation, chunks, index, reason, "") { … }
MATCHER_P3(IncrementalInvalidation, chunks, index, chunk_rect, "") { … }
TEST_P(RasterInvalidatorTest, ImplicitFullLayerInvalidation) { … }
TEST_P(RasterInvalidatorTest, LayerBounds) { … }
TEST_P(RasterInvalidatorTest, LayerOffsetChangeWithCachedSubsequence) { … }
TEST_P(RasterInvalidatorTest, LayerStateChangeWithCachedSubsequence) { … }
TEST_P(RasterInvalidatorTest, ReorderChunks) { … }
TEST_P(RasterInvalidatorTest, ReorderChunkSubsequences) { … }
TEST_P(RasterInvalidatorTest, ScrollDown) { … }
TEST_P(RasterInvalidatorTest, ScrollUp) { … }
TEST_P(RasterInvalidatorTest, ChunkAppearAndDisappear) { … }
TEST_P(RasterInvalidatorTest, InvalidateDrawableBounds) { … }
TEST_P(RasterInvalidatorTest, ChunkAppearAtEnd) { … }
TEST_P(RasterInvalidatorTest, UncacheableChunks) { … }
TEST_P(RasterInvalidatorTest, ClipPropertyChangeRounded) { … }
TEST_P(RasterInvalidatorTest, ClipPropertyChangeSimple) { … }
TEST_P(RasterInvalidatorTest, ClipChangeOnCachedSubsequence) { … }
TEST_P(RasterInvalidatorTest, ClipPropertyChangeWithOutsetForRasterEffects) { … }
TEST_P(RasterInvalidatorTest, ClipLocalTransformSpaceChange) { … }
TEST_P(RasterInvalidatorTest, ClipLocalTransformSpaceChangeNoInvalidation) { … }
TEST_P(RasterInvalidatorTest, TransformPropertyChange) { … }
TEST_P(RasterInvalidatorTest, TransformPropertyTinyChange) { … }
TEST_P(RasterInvalidatorTest, TransformPropertyTinyChangeScale) { … }
TEST_P(RasterInvalidatorTest, EffectLocalTransformSpaceChange) { … }
TEST_P(RasterInvalidatorTest, EffectLocalTransformSpaceChangeNoInvalidation) { … }
TEST_P(RasterInvalidatorTest, AliasEffectParentChanges) { … }
TEST_P(RasterInvalidatorTest, NestedAliasEffectParentChanges) { … }
TEST_P(RasterInvalidatorTest, EffectWithAliasTransformWhoseParentChanges) { … }
TEST_P(RasterInvalidatorTest, EffectChangeSimple) { … }
TEST_P(RasterInvalidatorTest, EffectChangeOnCachedSubsequence) { … }
}