#include "third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h"
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#include "cc/base/features.h"
#include "cc/input/overscroll_behavior.h"
#include "cc/layers/layer.h"
#include "cc/trees/clip_node.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/property_tree.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h"
#include "third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h"
#include "third_party/blink/renderer/platform/graphics/paint/effect_paint_property_node.h"
#include "third_party/blink/renderer/platform/graphics/paint/geometry_mapper.h"
#include "third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.h"
#include "third_party/blink/renderer/platform/graphics/paint/transform_paint_property_node.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
PropertyTreeManager::EffectState::EffectState(const CurrentEffectState& other)
: … { … }
PropertyTreeManager::CurrentEffectState::CurrentEffectState(
const EffectState& other)
: … { … }
PropertyTreeManager::PropertyTreeManager(PropertyTreeManagerClient& client,
cc::PropertyTrees& property_trees,
cc::Layer& root_layer,
LayerListBuilder& layer_list_builder,
int new_sequence_number)
: … { … }
PropertyTreeManager::~PropertyTreeManager() { … }
void PropertyTreeManager::Finalize() { … }
static void UpdateCcTransformLocalMatrix(
cc::TransformNode& compositor_node,
const TransformPaintPropertyNode& transform_node) { … }
static void SetTransformTreePageScaleFactor(
cc::TransformTree& transform_tree,
const cc::TransformNode& page_scale_node) { … }
bool PropertyTreeManager::DirectlyUpdateCompositedOpacityValue(
cc::LayerTreeHost& host,
const EffectPaintPropertyNode& effect) { … }
bool PropertyTreeManager::DirectlyUpdateScrollOffsetTransform(
cc::LayerTreeHost& host,
const TransformPaintPropertyNode& transform) { … }
bool PropertyTreeManager::DirectlyUpdateTransform(
cc::LayerTreeHost& host,
const TransformPaintPropertyNode& transform) { … }
bool PropertyTreeManager::DirectlyUpdatePageScaleTransform(
cc::LayerTreeHost& host,
const TransformPaintPropertyNode& transform) { … }
void PropertyTreeManager::DirectlySetScrollOffset(
cc::LayerTreeHost& host,
CompositorElementId element_id,
const gfx::PointF& scroll_offset) { … }
void PropertyTreeManager::DropCompositorScrollDeltaNextCommit(
cc::LayerTreeHost& host,
CompositorElementId element_id) { … }
uint32_t PropertyTreeManager::NonCompositedMainThreadScrollingReasons(
const TransformPaintPropertyNode& scroll_translation) const { … }
uint32_t PropertyTreeManager::GetMainThreadScrollingReasons(
const cc::LayerTreeHost& host,
const ScrollPaintPropertyNode& scroll) { … }
bool PropertyTreeManager::UsesCompositedScrolling(
const cc::LayerTreeHost& host,
const ScrollPaintPropertyNode& scroll) { … }
void PropertyTreeManager::SetupRootTransformNode() { … }
void PropertyTreeManager::SetupRootClipNode() { … }
void PropertyTreeManager::SetupRootEffectNode() { … }
void PropertyTreeManager::SetupRootScrollNode() { … }
static bool TransformsToAncestorHaveNonAxisAlignedActiveAnimation(
const TransformPaintPropertyNode& descendant,
const TransformPaintPropertyNode& ancestor) { … }
bool TransformsMayBe2dAxisMisaligned(const TransformPaintPropertyNode& a,
const TransformPaintPropertyNode& b) { … }
static bool IsConditionalRenderSurfaceReason(cc::RenderSurfaceReason reason) { … }
void PropertyTreeManager::SetCurrentEffectState(
const cc::EffectNode& cc_effect_node,
CcEffectType effect_type,
const EffectPaintPropertyNode& effect,
const ClipPaintPropertyNode& clip,
const TransformPaintPropertyNode& transform) { … }
int PropertyTreeManager::EnsureCompositorTransformNode(
const TransformPaintPropertyNode& transform_node) { … }
int PropertyTreeManager::EnsureCompositorPageScaleTransformNode(
const TransformPaintPropertyNode& node) { … }
int PropertyTreeManager::EnsureCompositorClipNode(
const ClipPaintPropertyNode& clip_node) { … }
int PropertyTreeManager::EnsureCompositorScrollNode(
const TransformPaintPropertyNode& scroll_translation) { … }
int PropertyTreeManager::EnsureCompositorScrollNodeInternal(
const ScrollPaintPropertyNode& scroll_node) { … }
int PropertyTreeManager::EnsureCompositorScrollAndTransformNode(
const TransformPaintPropertyNode& scroll_translation,
const gfx::Rect& scrolling_contents_cull_rect) { … }
int PropertyTreeManager::EnsureCompositorInnerScrollAndTransformNode(
const TransformPaintPropertyNode& scroll_translation) { … }
int PropertyTreeManager::EnsureCompositorOuterScrollAndTransformNode(
const TransformPaintPropertyNode& scroll_translation) { … }
void PropertyTreeManager::EmitClipMaskLayer() { … }
void PropertyTreeManager::CloseCcEffect() { … }
int PropertyTreeManager::SwitchToEffectNodeWithSynthesizedClip(
const EffectPaintPropertyNode& next_effect,
const ClipPaintPropertyNode& next_clip,
bool layer_draws_content) { … }
static bool IsNodeOnAncestorChain(const ClipPaintPropertyNode& find,
const ClipPaintPropertyNode& current,
const ClipPaintPropertyNode& ancestor) { … }
bool PropertyTreeManager::EffectStateMayBe2dAxisMisalignedToRenderSurface(
EffectState& state,
wtf_size_t index) { … }
bool PropertyTreeManager::CurrentEffectMayBe2dAxisMisalignedToRenderSurface() { … }
PropertyTreeManager::CcEffectType PropertyTreeManager::SyntheticEffectType(
const ClipPaintPropertyNode& clip) { … }
void PropertyTreeManager::ForceRenderSurfaceIfSyntheticRoundedCornerClip(
PropertyTreeManager::EffectState& state) { … }
struct PendingClip { … };
std::optional<gfx::RRectF> PropertyTreeManager::ShaderBasedRRect(
const ClipPaintPropertyNode& clip,
PropertyTreeManager::CcEffectType type,
const TransformPaintPropertyNode& transform,
const EffectPaintPropertyNode* next_effect) { … }
int PropertyTreeManager::SynthesizeCcEffectsForClipsIfNeeded(
const ClipPaintPropertyNode& target_clip,
const EffectPaintPropertyNode* next_effect) { … }
void PropertyTreeManager::BuildEffectNodesRecursively(
const EffectPaintPropertyNode& next_effect) { … }
static cc::RenderSurfaceReason ConditionalRenderSurfaceReasonForEffect(
const EffectPaintPropertyNode& effect) { … }
static cc::RenderSurfaceReason RenderSurfaceReasonForEffect(
const EffectPaintPropertyNode& effect) { … }
void PropertyTreeManager::PopulateCcEffectNode(
cc::EffectNode& effect_node,
const EffectPaintPropertyNode& effect,
int output_clip_id) { … }
void PropertyTreeManager::UpdateConditionalRenderSurfaceReasons(
const cc::LayerList& layers) { … }
void PropertyTreeManager::UpdatePixelMovingFilterClipExpanders() { … }
}
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(…)