#include "third_party/blink/renderer/platform/graphics/compositing/pending_layer.h"
#include "base/containers/adapters.h"
#include "cc/layers/scrollbar_layer_base.h"
#include "cc/layers/solid_color_layer.h"
#include "third_party/blink/renderer/platform/geometry/geometry_as_json.h"
#include "third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h"
#include "third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.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/heap/collection_support/heap_hash_map.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
namespace blink {
namespace {
void PreserveNearIntegralBounds(gfx::RectF& bounds) { … }
}
PendingLayer::PendingLayer(const PaintArtifact& artifact,
const PaintChunk& first_chunk,
CompositingType compositing_type)
: … { … }
void PendingLayer::Trace(Visitor* visitor) const { … }
gfx::Vector2dF PendingLayer::LayerOffset() const { … }
gfx::Size PendingLayer::LayerBounds() const { … }
gfx::RectF PendingLayer::MapRectKnownToBeOpaque(
const PropertyTreeState& new_state,
const FloatClipRect& mapped_layer_bounds) const { … }
std::unique_ptr<JSONObject> PendingLayer::ToJSON() const { … }
String PendingLayer::DebugName() const { … }
DOMNodeId PendingLayer::OwnerNodeId() const { … }
std::ostream& operator<<(std::ostream& os, const PendingLayer& layer) { … }
void PendingLayer::Upcast(const PropertyTreeState& new_state) { … }
const PaintChunk& PendingLayer::FirstPaintChunk() const { … }
const DisplayItem& PendingLayer::FirstDisplayItem() const { … }
bool PendingLayer::Matches(const PendingLayer& old_pending_layer) const { … }
static constexpr float kMergeSparsityAreaTolerance = …;
bool PendingLayer::CanMerge(
const PendingLayer& guest,
LCDTextPreference lcd_text_preference,
IsCompositedScrollFunction is_composited_scroll,
gfx::RectF& merged_bounds,
PropertyTreeState& merged_state,
gfx::RectF& merged_rect_known_to_be_opaque,
bool& merged_text_known_to_be_on_opaque_background,
wtf_size_t& merged_solid_color_chunk_index,
cc::HitTestOpaqueness& merged_hit_test_opaqueness) const { … }
bool PendingLayer::Merge(const PendingLayer& guest,
LCDTextPreference lcd_text_preference,
IsCompositedScrollFunction is_composited_scroll) { … }
std::optional<PropertyTreeState> PendingLayer::CanUpcastWith(
const PendingLayer& guest,
const PropertyTreeState& guest_state,
IsCompositedScrollFunction is_composited_scroll) const { … }
bool PendingLayer::CanMergeWithDecompositedBlendMode(
const PendingLayer& guest,
const PropertyTreeState& upcast_state,
IsCompositedScrollFunction is_composited_scroll) const { … }
const TransformPaintPropertyNode&
PendingLayer::ScrollTranslationForScrollHitTestLayer() const { … }
bool PendingLayer::PropertyTreeStateChanged(
const PendingLayer* old_pending_layer) const { … }
bool PendingLayer::MightOverlap(const PendingLayer& other) const { … }
void PendingLayer::DecompositeTransforms(PendingLayers& pending_layers) { … }
void PendingLayer::UpdateForeignLayer() { … }
void PendingLayer::UpdateScrollHitTestLayer(PendingLayer* old_pending_layer) { … }
void PendingLayer::UpdateScrollbarLayer(PendingLayer* old_pending_layer) { … }
void PendingLayer::UpdateContentLayer(PendingLayer* old_pending_layer,
bool tracks_raster_invalidations) { … }
void PendingLayer::UpdateSolidColorLayer(PendingLayer* old_pending_layer) { … }
bool PendingLayer::UsesSolidColorLayer() const { … }
SkColor4f PendingLayer::GetSolidColor() const { … }
void PendingLayer::UpdateCompositedLayer(PendingLayer* old_pending_layer,
cc::LayerSelection& layer_selection,
bool tracks_raster_invalidations,
cc::LayerTreeHost* layer_tree_host) { … }
void PendingLayer::UpdateCcLayerHitTestOpaqueness() const { … }
void PendingLayer::UpdateCompositedLayerForRepaint(
const PaintArtifact& repainted_artifact,
cc::LayerSelection& layer_selection) { … }
void PendingLayer::UpdateLayerProperties(cc::LayerSelection& layer_selection,
bool selection_only) { … }
SkColor4f PendingLayer::ComputeBackgroundColor() const { … }
}