#include "third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.h"
#include "base/containers/adapters.h"
#include "base/logging.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/numerics/safe_conversions.h"
#include "cc/input/layer_selection_bound.h"
#include "cc/layers/layer.h"
#include "cc/paint/display_item_list.h"
#include "cc/paint/paint_op_buffer.h"
#include "cc/paint/render_surface_filters.h"
#include "third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.h"
#include "third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.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/geometry_mapper.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/property_tree_state.h"
#include "third_party/blink/renderer/platform/graphics/paint/raster_invalidation_tracking.h"
#include "third_party/blink/renderer/platform/graphics/paint/scroll_paint_property_node.h"
#include "third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect_conversions.h"
namespace blink {
namespace {
class PaintOpBufferExt : public cc::PaintOpBuffer { … };
struct ScrollTranslationAction { … };
struct StateEntry { … };
struct EffectBoundsInfo { … };
template <typename Result>
class ConversionContext { … };
template <typename Result>
ConversionContext<Result>::~ConversionContext() { … }
template <typename Result>
void ConversionContext<Result>::TranslateForLayerOffsetOnce() { … }
static bool CombineClip(const ClipPaintPropertyNode& clip,
FloatRoundedRect& combined_clip_rect) { … }
template <typename Result>
ScrollTranslationAction ConversionContext<Result>::SwitchToClip(
const ClipPaintPropertyNode& target_clip) { … }
template <typename Result>
ScrollTranslationAction ConversionContext<Result>::StartClip(
const FloatRoundedRect& combined_clip_rect,
const ClipPaintPropertyNode& lowest_combined_clip_node) { … }
bool HasRealEffects(const EffectPaintPropertyNode& current,
const EffectPaintPropertyNode& ancestor) { … }
template <typename Result>
ScrollTranslationAction ConversionContext<Result>::SwitchToEffect(
const EffectPaintPropertyNode& target_effect) { … }
template <typename Result>
ScrollTranslationAction ConversionContext<Result>::StartEffect(
const EffectPaintPropertyNode& effect) { … }
template <typename Result>
void ConversionContext<Result>::UpdateEffectBounds(
const gfx::RectF& bounds,
const TransformPaintPropertyNode& transform) { … }
template <typename Result>
void ConversionContext<Result>::EndEffect() { … }
template <typename Result>
ScrollTranslationAction ConversionContext<Result>::EndClips() { … }
template <typename Result>
void ConversionContext<Result>::EndClip() { … }
template <typename Result>
void ConversionContext<Result>::PushState(
typename StateEntry::PairedType type) { … }
template <typename Result>
void ConversionContext<Result>::PopState() { … }
template <typename Result>
ScrollTranslationAction ConversionContext<Result>::SwitchToTransform(
const TransformPaintPropertyNode& target_transform) { … }
template <typename Result>
void ConversionContext<Result>::EndTransform() { … }
template <>
void ConversionContext<cc::DisplayItemList>::EmitDrawScrollingContentsOp(
PaintChunkIterator& chunk_it,
PaintChunkIterator end_chunk,
const TransformPaintPropertyNode& scroll_translation) { … }
template <>
ScrollTranslationAction
ConversionContext<cc::DisplayItemList>::ComputeScrollTranslationAction(
const TransformPaintPropertyNode& target_transform) const { … }
template <typename Result>
bool ConversionContext<Result>::HasDrawing(
PaintChunkIterator chunk_it,
const PropertyTreeState& chunk_state) const { … }
template <typename Result>
void ConversionContext<Result>::Convert(PaintChunkIterator& chunk_it,
PaintChunkIterator end_chunk,
const gfx::Rect* additional_cull_rect) { … }
}
void PaintChunksToCcLayer::ConvertInto(
const PaintChunkSubset& chunks,
const PropertyTreeState& layer_state,
const gfx::Vector2dF& layer_offset,
RasterUnderInvalidationCheckingParams* under_invalidation_checking_params,
cc::DisplayItemList& cc_list) { … }
PaintRecord PaintChunksToCcLayer::Convert(const PaintChunkSubset& chunks,
const PropertyTreeState& layer_state,
const gfx::Rect* cull_rect) { … }
namespace {
struct NonCompositedScroll { … };
class LayerPropertiesUpdater { … };
TouchAction LayerPropertiesUpdater::ShouldDisableCursorControl() { … }
void LayerPropertiesUpdater::UpdateTouchActionRegion(
const HitTestData& hit_test_data) { … }
void LayerPropertiesUpdater::UpdateWheelEventRegion(
const HitTestData& hit_test_data) { … }
void LayerPropertiesUpdater::UpdateScrollHitTestData(const PaintChunk& chunk) { … }
const TransformPaintPropertyNode&
LayerPropertiesUpdater::TopNonCompositedScroll(
const TransformPaintPropertyNode& scroll_translation) const { … }
void LayerPropertiesUpdater::AddNonCompositedScroll(const PaintChunk& chunk) { … }
void LayerPropertiesUpdater::UpdatePreviousNonCompositedScrolls(
const PaintChunk& chunk) { … }
const ScrollbarDisplayItem* NonCompositedScrollbarDisplayItem(
PaintChunkIterator chunk_it,
const cc::Layer& layer) { … }
void LayerPropertiesUpdater::UpdateForNonCompositedScrollbar(
const ScrollbarDisplayItem& scrollbar) { … }
void LayerPropertiesUpdater::UpdateRegionCaptureData(
const RegionCaptureData& region_capture_data) { … }
gfx::Point LayerPropertiesUpdater::MapSelectionBoundPoint(
const gfx::Point& point) const { … }
cc::LayerSelectionBound
LayerPropertiesUpdater::PaintedSelectionBoundToLayerSelectionBound(
const PaintedSelectionBound& bound) const { … }
void LayerPropertiesUpdater::UpdateLayerSelection(
const LayerSelectionData& layer_selection_data) { … }
void LayerPropertiesUpdater::Update() { … }
}
void PaintChunksToCcLayer::UpdateLayerProperties(
cc::Layer& layer,
const PropertyTreeState& layer_state,
const PaintChunkSubset& chunks,
cc::LayerSelection& layer_selection,
bool selection_only) { … }
}
WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(…)
WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(…)
WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(…)