#include "third_party/blink/renderer/platform/graphics/paint/paint_controller.h"
#include <memory>
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "cc/paint/paint_op.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h"
#include "third_party/blink/renderer/platform/graphics/paint/ignore_paint_timing_scope.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_chunk_subset.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_under_invalidation_checker.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/text/text_stream.h"
#include "third_party/skia/include/core/SkTextBlob.h"
#if DCHECK_IS_ON()
#include "base/debug/crash_logging.h"
#include "base/debug/stack_trace.h"
#include "components/crash/core/common/crash_key.h"
#endif
namespace blink {
void PaintControllerPersistentData::InvalidateAllForTesting() { … }
size_t PaintControllerPersistentData::ApproximateUnsharedMemoryUsage() const { … }
bool PaintControllerPersistentData::ClientCacheIsValid(
const DisplayItemClient& client) const { … }
wtf_size_t PaintControllerPersistentData::GetSubsequenceIndex(
DisplayItemClientId client_id) const { … }
const SubsequenceMarkers* PaintControllerPersistentData::GetSubsequenceMarkers(
DisplayItemClientId client_id) const { … }
void PaintControllerPersistentData::CommitNewDisplayItems(
PaintArtifact& new_paint_artifact,
SubsequencesData new_subsequences) { … }
PaintController::CounterForTesting* PaintController::counter_for_testing_ = …;
PaintController::PaintController(bool record_debug_info,
PaintControllerPersistentData* persistent_data,
PaintBenchmarkMode benchmark_mode)
: … { … }
PaintController::~PaintController() { … }
void PaintController::EnsureChunk() { … }
void PaintController::RecordHitTestData(const DisplayItemClient& client,
const gfx::Rect& rect,
TouchAction touch_action,
bool blocking_wheel,
cc::HitTestOpaqueness opaqueness,
DisplayItem::Type type) { … }
void PaintController::RecordRegionCaptureData(
const DisplayItemClient& client,
const RegionCaptureCropId& crop_id,
const gfx::Rect& rect) { … }
void PaintController::RecordScrollHitTestData(
const DisplayItemClient& client,
DisplayItem::Type type,
const TransformPaintPropertyNode* scroll_translation,
const gfx::Rect& scroll_hit_test_rect,
cc::HitTestOpaqueness hit_test_opaqueness,
const gfx::Rect& scrolling_contents_cull_rect) { … }
void PaintController::RecordSelection(
std::optional<PaintedSelectionBound> start,
std::optional<PaintedSelectionBound> end,
String debug_info) { … }
bool PaintController::UseCachedItemIfPossible(const DisplayItemClient& client,
DisplayItem::Type type) { … }
#if DCHECK_IS_ON()
void PaintController::AssertLastCheckedCachedItem(
const DisplayItemClient& client,
DisplayItem::Type type) { … }
#endif
sk_sp<SkTextBlob> PaintController::CachedTextBlob() const { … }
const DisplayItem* PaintController::MatchingCachedItemToBeRepainted() const { … }
bool PaintController::UseCachedSubsequenceIfPossible(
const DisplayItemClient& client) { … }
wtf_size_t PaintController::BeginSubsequence(const DisplayItemClient& client) { … }
void PaintController::EndSubsequence(wtf_size_t subsequence_index) { … }
void PaintController::CheckNewItem(DisplayItem& display_item) { … }
void PaintController::MarkClientForValidation(const DisplayItemClient& client) { … }
void PaintController::ProcessNewItem(const DisplayItemClient& client,
DisplayItem& display_item) { … }
void PaintController::CheckNewChunkId(const PaintChunk::Id& id) { … }
void PaintController::CheckNewChunk() { … }
void PaintController::RecordDebugInfo(const DisplayItemClient& client) { … }
void PaintController::UpdateCurrentPaintChunkProperties(
const PaintChunk::Id& id,
const DisplayItemClient& client,
const PropertyTreeStateOrAlias& properties) { … }
void PaintController::UpdateCurrentPaintChunkProperties(
const PropertyTreeStateOrAlias& properties) { … }
bool PaintController::ClientCacheIsValid(
const DisplayItemClient& client) const { … }
wtf_size_t PaintController::FindItemFromIdIndexMap(
const DisplayItem::Id& id,
const IdIndexMap& display_item_id_index_map,
const DisplayItemList& list) { … }
void PaintController::AddToIdIndexMap(const DisplayItem::Id& id,
wtf_size_t index,
IdIndexMap& map) { … }
wtf_size_t PaintController::FindCachedItem(const DisplayItemClient& client,
const DisplayItem::Id& id) { … }
wtf_size_t PaintController::FindOutOfOrderCachedItemForward(
const DisplayItemClient& client,
const DisplayItem::Id& id) { … }
void PaintController::AppendSubsequenceByMoving(const DisplayItemClient& client,
wtf_size_t subsequence_index,
wtf_size_t start_chunk_index,
wtf_size_t end_chunk_index) { … }
DISABLE_CFI_PERF
const PaintArtifact& PaintController::CommitNewDisplayItems() { … }
PaintUnderInvalidationChecker&
PaintController::EnsureUnderInvalidationChecker() { … }
bool PaintController::IsCheckingUnderInvalidationForTesting() const { … }
bool PaintController::IsCheckingUnderInvalidation() const { … }
void PaintController::SetFirstPainted() { … }
void PaintController::SetTextPainted() { … }
void PaintController::SetImagePainted() { … }
void PaintController::BeginFrame(const void* frame) { … }
FrameFirstPaint PaintController::EndFrame(const void* frame) { … }
void PaintController::ValidateNewChunkClient(const DisplayItemClient& client) { … }
}