#include "third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.h"
#include <initializer_list>
#include "cc/layers/layer.h"
#include "cc/paint/display_item_list.h"
#include "cc/paint/paint_filter.h"
#include "cc/paint/paint_flags.h"
#include "cc/paint/paint_op_buffer_iterator.h"
#include "cc/paint/render_surface_filters.h"
#include "cc/test/paint_op_matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h"
#include "third_party/blink/renderer/platform/graphics/paint/display_item_list.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h"
#include "third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_chunk.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_chunk_subset.h"
#include "third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/testing/fake_display_item_client.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 "ui/gfx/geometry/skia_conversions.h"
namespace blink {
namespace {
PaintOpEq;
PaintOpIs;
ElementsAre;
RegionCaptureData* MakeRegionCaptureData(
std::initializer_list<std::pair<RegionCaptureCropId, gfx::Rect>>
map_values) { … }
class PaintChunksToCcLayerTest : public testing::Test,
public PaintTestConfigurations { … };
INSTANTIATE_PAINT_TEST_SUITE_P(…);
const DisplayItemClient& DefaultClient() { … }
PaintChunk::Id DefaultId() { … }
void UpdateLayerProperties(cc::Layer& layer,
const PropertyTreeState& layer_state,
const PaintChunkSubset& chunks) { … }
class TestChunks { … };
TEST_P(PaintChunksToCcLayerTest, EffectGroupingSimple) { … }
TEST_P(PaintChunksToCcLayerTest, EffectGroupingNested) { … }
TEST_P(PaintChunksToCcLayerTest, EffectFilterGroupingNestedWithTransforms) { … }
TEST_P(PaintChunksToCcLayerTest, InterleavedClipEffect) { … }
TEST_P(PaintChunksToCcLayerTest, ClipSpaceInversion) { … }
TEST_P(PaintChunksToCcLayerTest, OpacityEffectSpaceInversion) { … }
TEST_P(PaintChunksToCcLayerTest, FilterEffectSpaceInversion) { … }
TEST_P(PaintChunksToCcLayerTest, NonRootLayerSimple) { … }
TEST_P(PaintChunksToCcLayerTest, NonRootLayerTransformEscape) { … }
TEST_P(PaintChunksToCcLayerTest, EffectWithNoOutputClip) { … }
TEST_P(PaintChunksToCcLayerTest,
EffectWithNoOutputClipNestedInDecompositedEffect) { … }
TEST_P(PaintChunksToCcLayerTest,
EffectWithNoOutputClipNestedInCompositedEffect) { … }
TEST_P(PaintChunksToCcLayerTest,
EffectWithNoOutputClipNestedInCompositedEffectAndClip) { … }
TEST_P(PaintChunksToCcLayerTest, VisualRect) { … }
TEST_P(PaintChunksToCcLayerTest, NoncompositedClipPath) { … }
TEST_P(PaintChunksToCcLayerTest, EmptyClipsAreElided) { … }
TEST_P(PaintChunksToCcLayerTest, NonEmptyClipsAreStored) { … }
TEST_P(PaintChunksToCcLayerTest, EmptyEffectsAreStored) { … }
TEST_P(PaintChunksToCcLayerTest, CombineClips) { … }
TEST_P(PaintChunksToCcLayerTest, CombineClipsAcrossTransform) { … }
TEST_P(PaintChunksToCcLayerTest, CombineClipsWithRoundedRects) { … }
TEST_P(PaintChunksToCcLayerTest, ChunksSamePropertyTreeState) { … }
TEST_P(PaintChunksToCcLayerTest, NoOpForIdentityTransforms) { … }
TEST_P(PaintChunksToCcLayerTest, EffectsWithSameTransform) { … }
TEST_P(PaintChunksToCcLayerTest, NestedEffectsWithSameTransform) { … }
TEST_P(PaintChunksToCcLayerTest, NoopTransformIsNotEmitted) { … }
TEST_P(PaintChunksToCcLayerTest, OnlyNoopTransformIsNotEmitted) { … }
TEST_P(PaintChunksToCcLayerTest, NoopTransformFirstThenBackToParent) { … }
TEST_P(PaintChunksToCcLayerTest, ClipUndoesNoopTransform) { … }
TEST_P(PaintChunksToCcLayerTest, EffectUndoesNoopTransform) { … }
TEST_P(PaintChunksToCcLayerTest, NoopClipDoesNotEmitItems) { … }
TEST_P(PaintChunksToCcLayerTest, EffectUndoesNoopClip) { … }
TEST_P(PaintChunksToCcLayerTest, NoopEffectDoesNotEmitItems) { … }
TEST_P(PaintChunksToCcLayerTest, EmptyChunkRect) { … }
static sk_sp<cc::PaintFilter> MakeFilter(gfx::RectF bounds) { … }
TEST_P(PaintChunksToCcLayerTest, ReferenceFilterOnEmptyChunk) { … }
TEST_P(PaintChunksToCcLayerTest, ReferenceFilterOnChunkWithDrawingDisplayItem) { … }
TEST_P(PaintChunksToCcLayerTest, FilterClipExpanderUnderClip) { … }
TEST_P(PaintChunksToCcLayerTest, ScrollingContentsToPaintRecord) { … }
TEST_P(PaintChunksToCcLayerTest, ScrollingContentsIntoDisplayItemList) { … }
TEST_P(PaintChunksToCcLayerTest,
ScrollingContentsIntoDisplayItemListStartingFromNestedState) { … }
TEST_P(PaintChunksToCcLayerTest,
ScrollingContentsInterlacingNonScrollingIntoDisplayItemList) { … }
TEST_P(PaintChunksToCcLayerTest, NestedScrollingContentsIntoDisplayItemList) { … }
TEST_P(PaintChunksToCcLayerTest,
NestedScrollingContentsIntoDisplayItemListStartingFromNestedState) { … }
TEST_P(PaintChunksToCcLayerTest, NonCompositedFixedAttachmentBackground) { … }
TEST_P(PaintChunksToCcLayerTest,
UpdateLayerPropertiesRegionCaptureDataSetOnLayer) { … }
TEST_P(PaintChunksToCcLayerTest,
UpdateLayerPropertiesRegionCaptureDataUsesLayerOffset) { … }
TEST_P(PaintChunksToCcLayerTest, UpdateLayerPropertiesRegionCaptureDataEmpty) { … }
TEST_P(PaintChunksToCcLayerTest,
UpdateLayerPropertiesRegionCaptureDataEmptyBounds) { … }
TEST_P(PaintChunksToCcLayerTest,
UpdateLayerPropertiesRegionCaptureDataMultipleChunks) { … }
TEST_P(PaintChunksToCcLayerTest, NonCompositedBackdropFilter) { … }
}
}