#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "cc/paint/paint_op_buffer.h"
#include <algorithm>
#include <utility>
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/types/optional_util.h"
#include "cc/paint/paint_flags.h"
#include "cc/paint/paint_image_builder.h"
#include "cc/paint/paint_op.h"
#include "cc/paint/paint_op_buffer_iterator.h"
#include "cc/paint/paint_op_reader.h"
#include "cc/paint/paint_op_writer.h"
#include "cc/paint/paint_record.h"
#include "cc/paint/scoped_raster_flags.h"
#include "cc/paint/skottie_serialization_history.h"
#include "third_party/skia/include/gpu/GrRecordingContext.h"
#include "third_party/skia/include/gpu/graphite/Recorder.h"
namespace cc {
PlaybackCallbacks::PlaybackCallbacks() = default;
PlaybackCallbacks::~PlaybackCallbacks() = default;
PlaybackCallbacks::PlaybackCallbacks(const PlaybackCallbacks&) = default;
PlaybackCallbacks& PlaybackCallbacks::operator=(const PlaybackCallbacks&) =
default;
PlaybackParams::PlaybackParams(ImageProvider* image_provider,
const SkM44& original_ctm,
const PlaybackCallbacks& callbacks)
: … { … }
PlaybackParams::~PlaybackParams() = default;
PaintOpBuffer::SerializeOptions::SerializeOptions(
ImageProvider* image_provider,
TransferCacheSerializeHelper* transfer_cache,
ClientPaintCache* paint_cache,
SkStrikeServer* strike_server,
sk_sp<SkColorSpace> color_space,
SkottieSerializationHistory* skottie_serialization_history,
bool can_use_lcd_text,
bool context_supports_distance_field_text,
int max_texture_size,
const ScrollOffsetMap* raster_inducing_scroll_offsets)
: … { … }
PaintOpBuffer::SerializeOptions::SerializeOptions() = default;
PaintOpBuffer::SerializeOptions::SerializeOptions(const SerializeOptions&) =
default;
PaintOpBuffer::SerializeOptions& PaintOpBuffer::SerializeOptions::operator=(
const SerializeOptions&) = default;
PaintOpBuffer::SerializeOptions::~SerializeOptions() = default;
PaintOpBuffer::PaintOpBuffer() = default;
PaintOpBuffer::PaintOpBuffer(PaintOpBuffer&& other) { … }
PaintOpBuffer::~PaintOpBuffer() { … }
PaintOpBuffer& PaintOpBuffer::operator=(PaintOpBuffer&& other) { … }
void PaintOpBuffer::DestroyOps() { … }
void PaintOpBuffer::Reset() { … }
void PaintOpBuffer::ResetRetainingBuffer() { … }
void PaintOpBuffer::Playback(SkCanvas* canvas) const { … }
void PaintOpBuffer::Playback(SkCanvas* canvas,
const PlaybackParams& params,
bool local_ctm) const { … }
PaintRecord PaintOpBuffer::ReleaseAsRecord() { … }
void PaintOpBuffer::Playback(SkCanvas* canvas,
const PlaybackParams& params,
bool local_ctm,
const std::vector<size_t>* offsets) const { … }
bool PaintOpBuffer::Deserialize(const volatile void* input,
size_t input_size,
const PaintOp::DeserializeOptions& options) { … }
sk_sp<PaintOpBuffer> PaintOpBuffer::MakeFromMemory(
const volatile void* input,
size_t input_size,
const PaintOp::DeserializeOptions& options) { … }
SkRect PaintOpBuffer::GetFixedScaleBounds(const SkMatrix& ctm,
const SkRect& bounds,
int max_texture_size) { … }
PaintOpBuffer::BufferDataPtr PaintOpBuffer::ReallocBuffer(size_t new_size) { … }
void* PaintOpBuffer::AllocatePaintOpSlowPath(uint16_t aligned_size) { … }
void PaintOpBuffer::ShrinkToFit() { … }
PaintOpBuffer::BufferDataPtr PaintOpBuffer::ReallocIfNeededToFit() { … }
bool PaintOpBuffer::EqualsForTesting(const PaintOpBuffer& other) const { … }
bool PaintOpBuffer::NeedsAdditionalInvalidationForLCDText(
const PaintOpBuffer& old_buffer) const { … }
void PaintOpBuffer::UpdateSaveLayerBounds(size_t offset, const SkRect& bounds) { … }
PaintOpBuffer::Iterator PaintOpBuffer::begin() const { … }
PaintOpBuffer::Iterator PaintOpBuffer::end() const { … }
const PaintOp& PaintOpBuffer::GetOpAtForTesting(size_t index) const { … }
}