#include "cc/trees/damage_tracker.h"
#include <stddef.h>
#include <limits>
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/unguessable_token.h"
#include "cc/base/math_util.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/view_transition_content_layer_impl.h"
#include "cc/paint/filter_operation.h"
#include "cc/paint/filter_operations.h"
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_raster_source.h"
#include "cc/test/layer_tree_impl_test_base.h"
#include "cc/test/property_tree_test_utils.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/transform_node.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/quad_f.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/vector2d_f.h"
namespace cc {
namespace {
class TestLayerImpl : public LayerImpl { … };
TestLayerImpl::TestLayerImpl(LayerTreeImpl* tree_impl, int id)
: … { … }
void TestLayerImpl::AddDamageRect(const gfx::Rect& damage_rect) { … }
void TestLayerImpl::SetDamageReasons(DamageReasonSet reasons) { … }
gfx::Rect TestLayerImpl::GetDamageRect() const { … }
DamageReasonSet TestLayerImpl::GetDamageReasons() const { … }
void TestLayerImpl::ResetChangeTracking() { … }
class TestViewTransitionContentLayerImpl
: public ViewTransitionContentLayerImpl { … };
TestViewTransitionContentLayerImpl::TestViewTransitionContentLayerImpl(
LayerTreeImpl* tree_impl,
int id,
const viz::ViewTransitionElementResourceId& resource_id,
bool is_live_content_layer)
: … { … }
void TestViewTransitionContentLayerImpl::AddDamageRect(
const gfx::Rect& damage_rect) { … }
gfx::Rect TestViewTransitionContentLayerImpl::GetDamageRect() const { … }
void TestViewTransitionContentLayerImpl::ResetChangeTracking() { … }
void ClearDamageForAllSurfaces(LayerImpl* root) { … }
void SetCopyRequest(LayerImpl* root) { … }
class DamageTrackerTest : public LayerTreeImplTestBase, public testing::Test { … };
TEST_F(DamageTrackerTest, SanityCheckTestTreeWithOneSurface) { … }
TEST_F(DamageTrackerTest, SanityCheckTestTreeWithTwoSurfaces) { … }
TEST_F(DamageTrackerTest, VerifyDamageForUpdateRects) { … }
TEST_F(DamageTrackerTest, VerifyDamageForLayerDamageRects) { … }
TEST_F(DamageTrackerTest, VerifyDamageForLayerUpdateAndDamageRects) { … }
TEST_F(DamageTrackerTest, VerifyDamageForPropertyChanges) { … }
TEST_F(DamageTrackerTest,
VerifyDamageForPropertyChangesFromContributingContents) { … }
TEST_F(DamageTrackerTest, EffectPropertyChangeNoSurface) { … }
TEST_F(DamageTrackerTest, TransformPropertyChangeNoSurface) { … }
TEST_F(DamageTrackerTest,
VerifyDamageForUpdateAndDamageRectsFromContributingContents) { … }
TEST_F(DamageTrackerTest, VerifyDamageWhenSurfaceRemoved) { … }
TEST_F(DamageTrackerTest, VerifyDamageForTransformedLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForPerspectiveClippedLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForBlurredSurface) { … }
TEST_F(DamageTrackerTest, VerifyDamageForImageFilter) { … }
TEST_F(DamageTrackerTest, VerifyDamageForTransformedImageFilter) { … }
TEST_F(DamageTrackerTest, VerifyDamageForHighDPIImageFilter) { … }
TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForNewUnchangedLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForMultipleLayers) { … }
TEST_F(DamageTrackerTest, VerifyDamageForNestedSurfaces) { … }
TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromDescendantLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromDescendantSurface) { … }
TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromViewTransitionLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForSurfaceChangeFromAncestorLayer) { … }
TEST_F(DamageTrackerTest, VerifyDamageForAddingAndRemovingRenderSurfaces) { … }
TEST_F(DamageTrackerTest, VerifyNoDamageWhenNothingChanged) { … }
TEST_F(DamageTrackerTest, VerifyNoDamageForUpdateRectThatDoesNotDrawContent) { … }
TEST_F(DamageTrackerTest, VerifyDamageForMask) { … }
TEST_F(DamageTrackerTest, DamageWhenAddedExternally) { … }
TEST_F(DamageTrackerTest, VerifyDamageWithNoContributingLayers) { … }
TEST_F(DamageTrackerTest, VerifyDamageAccumulatesUntilReset) { … }
TEST_F(DamageTrackerTest, HugeDamageRect) { … }
TEST_F(DamageTrackerTest, DamageRectTooBig) { … }
TEST_F(DamageTrackerTest, DamageRectTooBigWithFilter) { … }
TEST_F(DamageTrackerTest, DamageRectTooBigInRenderSurface) { … }
TEST_F(DamageTrackerTest, DamageRectTooBigInRenderSurfaceWithFilter) { … }
TEST_F(DamageTrackerTest, CanUseCachedBackdropFilterResultTest) { … }
TEST_F(DamageTrackerTest, DamageRectOnlyVisibleContentsMoveToOutside) { … }
TEST_F(DamageTrackerTest, DamageRectOnlyVisibleContentsLargeTwoContents) { … }
TEST_F(DamageTrackerTest,
DamageRectOnlyVisibleContentsHugeContentPartiallyVisible) { … }
TEST_F(DamageTrackerTest, VerifyDamageExpansionWithBackdropBlurFilters) { … }
}
}