chromium/cc/paint/paint_op.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "cc/paint/paint_op.h"

#include <algorithm>
#include <iterator>
#include <limits>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/containers/span.h"
#include "base/feature_list.h"
#include "base/functional/function_ref.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/values_equivalent.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/types/optional_util.h"
#include "cc/paint/decoded_draw_image.h"
#include "cc/paint/display_item_list.h"
#include "cc/paint/image_provider.h"
#include "cc/paint/paint_filter.h"
#include "cc/paint/paint_flags.h"
#include "cc/paint/paint_image_builder.h"
#include "cc/paint/paint_op_reader.h"
#include "cc/paint/paint_op_writer.h"
#include "cc/paint/paint_record.h"
#include "cc/paint/skottie_serialization_history.h"
#include "skia/ext/draw_gainmap_image.h"
#include "third_party/skia/include/core/SkAnnotation.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "third_party/skia/include/core/SkSerialProcs.h"
#include "third_party/skia/include/core/SkTextBlob.h"
#include "third_party/skia/include/core/SkTiledImageUtils.h"
#include "third_party/skia/include/core/SkVertices.h"
#include "third_party/skia/include/docs/SkPDFDocument.h"
#include "third_party/skia/include/private/chromium/Slug.h"
#include "third_party/skia/src/core/SkCanvasPriv.h"
#include "ui/gfx/color_conversion_sk_filter_cache.h"
#include "ui/gfx/geometry/skia_conversions.h"

namespace cc {
namespace  // namespace

#define M
uint16_t PaintOp::g_type_to_aligned_size[kNumOpTypes] =;
#undef M

#define M
bool PaintOp::g_is_draw_op[kNumOpTypes] =;
#undef M

#define M
bool PaintOp::g_has_paint_flags[kNumOpTypes] =;
#undef M

const SkRect PaintOp::kUnsetRect =;

std::string PaintOpTypeToString(PaintOpType type) {}

bool IsDiscardableImage(const PaintImage& image,
                        gfx::ContentColorUsage* content_color_usage) {}

bool OpHasDiscardableImagesImpl(const PaintOp& op) {}

#undef TYPES

std::ostream& operator<<(std::ostream& os, PaintOpType type) {}

void AnnotateOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void ClipPathOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void ClipRectOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void ClipRRectOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void ConcatOp::Serialize(PaintOpWriter& writer,
                         const PaintFlags* flags_to_serialize,
                         const SkM44& current_ctm,
                         const SkM44& original_ctm) const {}

void CustomDataOp::Serialize(PaintOpWriter& writer,
                             const PaintFlags* flags_to_serialize,
                             const SkM44& current_ctm,
                             const SkM44& original_ctm) const {}

void DrawColorOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void DrawDRRectOp::Serialize(PaintOpWriter& writer,
                             const PaintFlags* flags_to_serialize,
                             const SkM44& current_ctm,
                             const SkM44& original_ctm) const {}

void DrawImageOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void DrawImageRectOp::Serialize(PaintOpWriter& writer,
                                const PaintFlags* flags_to_serialize,
                                const SkM44& current_ctm,
                                const SkM44& original_ctm) const {}

void DrawIRectOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void DrawLineOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void DrawLineLiteOp::Serialize(PaintOpWriter& writer,
                               const PaintFlags* flags_to_serialize,
                               const SkM44& current_ctm,
                               const SkM44& original_ctm) const {}

void DrawArcOp::Serialize(PaintOpWriter& writer,
                          const PaintFlags* flags_to_serialize,
                          const SkM44& current_ctm,
                          const SkM44& original_ctm) const {}

void DrawArcLiteOp::Serialize(PaintOpWriter& writer,
                              const PaintFlags* flags_to_serialize,
                              const SkM44& current_ctm,
                              const SkM44& original_ctm) const {}

void DrawOvalOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void DrawPathOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void DrawRecordOp::Serialize(PaintOpWriter& writer,
                             const PaintFlags* flags_to_serialize,
                             const SkM44& current_ctm,
                             const SkM44& original_ctm) const {}

void DrawRectOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void DrawRRectOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void DrawScrollingContentsOp::Serialize(PaintOpWriter& writer,
                                        const PaintFlags* flags_to_serialize,
                                        const SkM44& current_ctm,
                                        const SkM44& original_ctm) const {}

void DrawVerticesOp::Serialize(PaintOpWriter& writer,
                               const PaintFlags* flags_to_serialize,
                               const SkM44& current_ctm,
                               const SkM44& original_ctm) const {}

namespace {

template <typename T>
void SerializeSkottieMap(
    const base::flat_map<SkottieResourceIdHash, T>& map,
    PaintOpWriter& writer,
    base::FunctionRef<void(const T&, PaintOpWriter&)> value_serializer) {}

void SerializeSkottieFrameData(const SkM44& current_ctm,
                               const SkottieFrameData& frame_data,
                               PaintOpWriter& writer) {}

}  // namespace

void DrawSkottieOp::Serialize(PaintOpWriter& writer,
                              const PaintFlags* flags_to_serialize,
                              const SkM44& current_ctm,
                              const SkM44& original_ctm) const {}

void DrawSlugOp::SerializeSlugs(
    const sk_sp<sktext::gpu::Slug>& slug,
    const std::vector<sk_sp<sktext::gpu::Slug>>& extra_slugs,
    PaintOpWriter& writer,
    const PaintFlags* flags_to_serialize,
    const SkM44& current_ctm) {}

void DrawSlugOp::Serialize(PaintOpWriter& writer,
                           const PaintFlags* flags_to_serialize,
                           const SkM44& current_ctm,
                           const SkM44& original_ctm) const {}

void DrawTextBlobOp::Serialize(PaintOpWriter& writer,
                               const PaintFlags* flags_to_serialize,
                               const SkM44& current_ctm,
                               const SkM44& original_ctm) const {}

void NoopOp::Serialize(PaintOpWriter& writer,
                       const PaintFlags* flags_to_serialize,
                       const SkM44& current_ctm,
                       const SkM44& original_ctm) const {}

void RestoreOp::Serialize(PaintOpWriter& writer,
                          const PaintFlags* flags_to_serialize,
                          const SkM44& current_ctm,
                          const SkM44& original_ctm) const {}

void RotateOp::Serialize(PaintOpWriter& writer,
                         const PaintFlags* flags_to_serialize,
                         const SkM44& current_ctm,
                         const SkM44& original_ctm) const {}

void SaveOp::Serialize(PaintOpWriter& writer,
                       const PaintFlags* flags_to_serialize,
                       const SkM44& current_ctm,
                       const SkM44& original_ctm) const {}

void SaveLayerOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void SaveLayerAlphaOp::Serialize(PaintOpWriter& writer,
                                 const PaintFlags* flags_to_serialize,
                                 const SkM44& current_ctm,
                                 const SkM44& original_ctm) const {}

void SaveLayerFiltersOp::Serialize(PaintOpWriter& writer,
                                   const PaintFlags* flags_to_serialize,
                                   const SkM44& current_ctm,
                                   const SkM44& original_ctm) const {}

void ScaleOp::Serialize(PaintOpWriter& writer,
                        const PaintFlags* flags_to_serialize,
                        const SkM44& current_ctm,
                        const SkM44& original_ctm) const {}

void SetMatrixOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void SetNodeIdOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

void TranslateOp::Serialize(PaintOpWriter& writer,
                            const PaintFlags* flags_to_serialize,
                            const SkM44& current_ctm,
                            const SkM44& original_ctm) const {}

PaintOp* AnnotateOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* ClipPathOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* ClipRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* ClipRRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* ConcatOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* CustomDataOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawColorOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawDRRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawImageOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawImageRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawIRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawLineOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawLineLiteOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawArcOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawArcLiteOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawOvalOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawPathOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawRecordOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawRRectOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawScrollingContentsOp::Deserialize(PaintOpReader& reader,
                                              void* output) {}

PaintOp* DrawVerticesOp::Deserialize(PaintOpReader& reader, void* output) {}

namespace {

// |max_map_size| is purely a safety mechanism to prevent disastrous behavior
// (trying to allocate an enormous map, looping for long periods of time, etc)
// in case the serialization buffer is corrupted somehow.
template <typename T>
bool DeserializeSkottieMap(
    base::flat_map<SkottieResourceIdHash, T>& map,
    std::optional<size_t> max_map_size,
    PaintOpReader& reader,
    base::FunctionRef<T(PaintOpReader& reader)> value_deserializer) {}

SkottieFrameData DeserializeSkottieFrameData(PaintOpReader& reader) {}

SkColor DeserializeSkottieColor(PaintOpReader& reader) {}

SkottieTextPropertyValue DeserializeSkottieTextPropertyValue(
    PaintOpReader& reader) {}

}  // namespace

PaintOp* DrawSkottieOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawSlugOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* DrawTextBlobOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* NoopOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* RestoreOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* RotateOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* SaveOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* SaveLayerOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* SaveLayerAlphaOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* SaveLayerFiltersOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* ScaleOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* SetMatrixOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* SetNodeIdOp::Deserialize(PaintOpReader& reader, void* output) {}

PaintOp* TranslateOp::Deserialize(PaintOpReader& reader, void* output) {}

void AnnotateOp::Raster(const AnnotateOp* op,
                        SkCanvas* canvas,
                        const PlaybackParams& params) {}

void ClipPathOp::Raster(const ClipPathOp* op,
                        SkCanvas* canvas,
                        const PlaybackParams& params) {}

void ClipRectOp::Raster(const ClipRectOp* op,
                        SkCanvas* canvas,
                        const PlaybackParams& params) {}

void ClipRRectOp::Raster(const ClipRRectOp* op,
                         SkCanvas* canvas,
                         const PlaybackParams& params) {}

void ConcatOp::Raster(const ConcatOp* op,
                      SkCanvas* canvas,
                      const PlaybackParams& params) {}

void CustomDataOp::Raster(const CustomDataOp* op,
                          SkCanvas* canvas,
                          const PlaybackParams& params) {}

void DrawColorOp::Raster(const DrawColorOp* op,
                         SkCanvas* canvas,
                         const PlaybackParams& params) {}

void DrawDRRectOp::RasterWithFlags(const DrawDRRectOp* op,
                                   const PaintFlags* flags,
                                   SkCanvas* canvas,
                                   const PlaybackParams& params) {}

// Helper class for applying tone mapping on the fly in DrawImage and
// DrawImageRect.
class DrawImageToneMapUtil {};

void DrawImageOp::RasterWithFlags(const DrawImageOp* op,
                                  const PaintFlags* flags,
                                  SkCanvas* canvas,
                                  const PlaybackParams& params) {}

void DrawImageRectOp::RasterWithFlags(const DrawImageRectOp* op,
                                      const PaintFlags* flags,
                                      SkCanvas* canvas,
                                      const PlaybackParams& params) {}

void DrawIRectOp::RasterWithFlags(const DrawIRectOp* op,
                                  const PaintFlags* flags,
                                  SkCanvas* canvas,
                                  const PlaybackParams& params) {}

void DrawLineOp::RasterWithFlags(const DrawLineOp* op,
                                 const PaintFlags* flags,
                                 SkCanvas* canvas,
                                 const PlaybackParams& params) {}

void DrawLineLiteOp::Raster(const DrawLineLiteOp* op,
                            SkCanvas* canvas,
                            const PlaybackParams& params) {}

void DrawArcOp::RasterWithFlags(const DrawArcOp* op,
                                const PaintFlags* flags,
                                SkCanvas* canvas,
                                const PlaybackParams& params) {}

void DrawArcOp::RasterWithFlagsImpl(const PaintFlags* flags,
                                    SkCanvas* canvas) const {}

void DrawArcLiteOp::Raster(const DrawArcLiteOp* op,
                           SkCanvas* canvas,
                           const PlaybackParams& params) {}

void DrawOvalOp::RasterWithFlags(const DrawOvalOp* op,
                                 const PaintFlags* flags,
                                 SkCanvas* canvas,
                                 const PlaybackParams& params) {}

void DrawPathOp::RasterWithFlags(const DrawPathOp* op,
                                 const PaintFlags* flags,
                                 SkCanvas* canvas,
                                 const PlaybackParams& params) {}

void DrawRecordOp::Raster(const DrawRecordOp* op,
                          SkCanvas* canvas,
                          const PlaybackParams& params) {}

void DrawRectOp::RasterWithFlags(const DrawRectOp* op,
                                 const PaintFlags* flags,
                                 SkCanvas* canvas,
                                 const PlaybackParams& params) {}

void DrawRRectOp::RasterWithFlags(const DrawRRectOp* op,
                                  const PaintFlags* flags,
                                  SkCanvas* canvas,
                                  const PlaybackParams& params) {}

void DrawScrollingContentsOp::Raster(const DrawScrollingContentsOp* op,
                                     SkCanvas* canvas,
                                     const PlaybackParams& params) {}

void DrawVerticesOp::RasterWithFlags(const DrawVerticesOp* op,
                                     const PaintFlags* flags,
                                     SkCanvas* canvas,
                                     const PlaybackParams& params) {}

void DrawSkottieOp::Raster(const DrawSkottieOp* op,
                           SkCanvas* canvas,
                           const PlaybackParams& params) {}

SkottieWrapper::FrameDataFetchResult DrawSkottieOp::GetImageAssetForRaster(
    SkCanvas* canvas,
    const PlaybackParams& params,
    SkottieResourceIdHash asset_id,
    float t_frame,
    sk_sp<SkImage>& sk_image,
    SkSamplingOptions& sampling_out) const {}

void DrawTextBlobOp::RasterWithFlags(const DrawTextBlobOp* op,
                                     const PaintFlags* flags,
                                     SkCanvas* canvas,
                                     const PlaybackParams& params) {}

void DrawSlugOp::RasterWithFlags(const DrawSlugOp* op,
                                 const PaintFlags* flags,
                                 SkCanvas* canvas,
                                 const PlaybackParams& params) {}

void RestoreOp::Raster(const RestoreOp* op,
                       SkCanvas* canvas,
                       const PlaybackParams& params) {}

void RotateOp::Raster(const RotateOp* op,
                      SkCanvas* canvas,
                      const PlaybackParams& params) {}

void SaveOp::Raster(const SaveOp* op,
                    SkCanvas* canvas,
                    const PlaybackParams& params) {}

void SaveLayerOp::RasterWithFlags(const SaveLayerOp* op,
                                  const PaintFlags* flags,
                                  SkCanvas* canvas,
                                  const PlaybackParams& params) {}

void SaveLayerAlphaOp::Raster(const SaveLayerAlphaOp* op,
                              SkCanvas* canvas,
                              const PlaybackParams& params) {}

void SaveLayerFiltersOp::RasterWithFlags(const SaveLayerFiltersOp* op,
                                         const PaintFlags* flags,
                                         SkCanvas* canvas,
                                         const PlaybackParams& params) {}

void ScaleOp::Raster(const ScaleOp* op,
                     SkCanvas* canvas,
                     const PlaybackParams& params) {}

void SetMatrixOp::Raster(const SetMatrixOp* op,
                         SkCanvas* canvas,
                         const PlaybackParams& params) {}

void SetNodeIdOp::Raster(const SetNodeIdOp* op,
                         SkCanvas* canvas,
                         const PlaybackParams& params) {}

void TranslateOp::Raster(const TranslateOp* op,
                         SkCanvas* canvas,
                         const PlaybackParams& params) {}

bool AnnotateOp::EqualsForTesting(const AnnotateOp& other) const {}

bool ClipPathOp::EqualsForTesting(const ClipPathOp& other) const {}

bool ClipRectOp::EqualsForTesting(const ClipRectOp& other) const {}

bool ClipRRectOp::EqualsForTesting(const ClipRRectOp& other) const {}

bool ConcatOp::EqualsForTesting(const ConcatOp& other) const {}

bool CustomDataOp::EqualsForTesting(const CustomDataOp& other) const {}

bool DrawColorOp::EqualsForTesting(const DrawColorOp& other) const {}

bool DrawDRRectOp::EqualsForTesting(const DrawDRRectOp& other) const {}

bool DrawImageOp::EqualsForTesting(const DrawImageOp& other) const {}

bool DrawImageRectOp::EqualsForTesting(const DrawImageRectOp& other) const {}

bool DrawIRectOp::EqualsForTesting(const DrawIRectOp& other) const {}

bool DrawLineOp::EqualsForTesting(const DrawLineOp& other) const {}

bool DrawLineLiteOp::EqualsForTesting(const DrawLineLiteOp& other) const {}

bool DrawArcOp::EqualsForTesting(const DrawArcOp& other) const {}

bool DrawArcLiteOp::EqualsForTesting(const DrawArcLiteOp& other) const {}

bool DrawOvalOp::EqualsForTesting(const DrawOvalOp& other) const {}

bool DrawPathOp::EqualsForTesting(const DrawPathOp& other) const {}

bool DrawRecordOp::EqualsForTesting(const DrawRecordOp& other) const {}

bool DrawRectOp::EqualsForTesting(const DrawRectOp& other) const {}

bool DrawRRectOp::EqualsForTesting(const DrawRRectOp& other) const {}

bool DrawScrollingContentsOp::EqualsForTesting(
    const DrawScrollingContentsOp& other) const {}

bool DrawVerticesOp::EqualsForTesting(const DrawVerticesOp& other) const {}

bool DrawSkottieOp::EqualsForTesting(const DrawSkottieOp& other) const {}

bool DrawTextBlobOp::EqualsForTesting(const DrawTextBlobOp& other) const {}

bool DrawSlugOp::EqualsForTesting(const DrawSlugOp& other) const {}

bool NoopOp::EqualsForTesting(const NoopOp& other) const {}

bool RestoreOp::EqualsForTesting(const RestoreOp& other) const {}

bool RotateOp::EqualsForTesting(const RotateOp& other) const {}

bool SaveOp::EqualsForTesting(const SaveOp& other) const {}

bool SaveLayerOp::EqualsForTesting(const SaveLayerOp& other) const {}

bool SaveLayerAlphaOp::EqualsForTesting(const SaveLayerAlphaOp& other) const {}

bool SaveLayerFiltersOp::EqualsForTesting(
    const SaveLayerFiltersOp& other) const {}

bool ScaleOp::EqualsForTesting(const ScaleOp& other) const {}

bool SetMatrixOp::EqualsForTesting(const SetMatrixOp& other) const {}

bool SetNodeIdOp::EqualsForTesting(const SetNodeIdOp& other) const {}

bool TranslateOp::EqualsForTesting(const TranslateOp& other) const {}

bool PaintOp::EqualsForTesting(const PaintOp& other) const {}

// static
bool PaintOp::TypeHasFlags(PaintOpType type) {}

void PaintOp::Raster(SkCanvas* canvas, const PlaybackParams& params) const {}

size_t PaintOp::Serialize(void* memory,
                          size_t size,
                          const SerializeOptions& options,
                          const PaintFlags* flags_to_serialize,
                          const SkM44& current_ctm,
                          const SkM44& original_ctm) const {}

PaintOp* PaintOp::Deserialize(const volatile void* input,
                              size_t input_size,
                              void* output,
                              size_t output_size,
                              size_t* read_bytes,
                              const DeserializeOptions& options) {}

PaintOp* PaintOp::DeserializeIntoPaintOpBuffer(
    const volatile void* input,
    size_t input_size,
    PaintOpBuffer* buffer,
    size_t* read_bytes,
    const DeserializeOptions& options) {}

// static
bool PaintOp::GetBounds(const PaintOp& op, SkRect* rect) {}

// static
gfx::Rect PaintOp::ComputePaintRect(const PaintOp& op,
                                    const SkRect& clip_rect,
                                    const SkMatrix& ctm) {}

// static
bool PaintOp::QuickRejectDraw(const PaintOp& op, const SkCanvas* canvas) {}

// static
bool PaintOp::OpHasDiscardableImages(const PaintOp& op) {}

void PaintOp::DestroyThis() {}

bool PaintOpWithFlags::HasDiscardableImagesFromFlags(
    gfx::ContentColorUsage* content_color_usage) const {}

void PaintOpWithFlags::RasterWithFlags(SkCanvas* canvas,
                                       const PaintFlags* raster_flags,
                                       const PlaybackParams& params) const {}

int ClipPathOp::CountSlowPaths() const {}

int DrawLineOp::CountSlowPaths() const {}

int DrawPathOp::CountSlowPaths() const {}

int DrawRecordOp::CountSlowPaths() const {}

bool DrawRecordOp::HasNonAAPaint() const {}

bool DrawRecordOp::HasDrawTextOps() const {}

bool DrawRecordOp::HasSaveLayerOps() const {}

bool DrawRecordOp::HasSaveLayerAlphaOps() const {}

bool DrawRecordOp::HasEffectsPreventingLCDTextForSaveLayerAlpha() const {}

bool DrawRecordOp::HasDiscardableImages(
    gfx::ContentColorUsage* content_color_usage) const {}

int DrawScrollingContentsOp::CountSlowPaths() const {}

bool DrawScrollingContentsOp::HasNonAAPaint() const {}

bool DrawScrollingContentsOp::HasDrawTextOps() const {}

bool DrawScrollingContentsOp::HasSaveLayerOps() const {}

bool DrawScrollingContentsOp::HasSaveLayerAlphaOps() const {}

bool DrawScrollingContentsOp::HasEffectsPreventingLCDTextForSaveLayerAlpha()
    const {}

bool DrawScrollingContentsOp::HasDiscardableImages(
    gfx::ContentColorUsage* content_color_usage) const {}

AnnotateOp::AnnotateOp() :{}

AnnotateOp::AnnotateOp(PaintCanvas::AnnotationType annotation_type,
                       const SkRect& rect,
                       sk_sp<SkData> data)
    :{}

AnnotateOp::~AnnotateOp() = default;

DrawImageOp::DrawImageOp() :{}

DrawImageOp::DrawImageOp(const PaintImage& image, SkScalar left, SkScalar top)
    :{}

DrawImageOp::DrawImageOp(const PaintImage& image,
                         SkScalar left,
                         SkScalar top,
                         const SkSamplingOptions& sampling,
                         const PaintFlags* flags)
    :{}

bool DrawImageOp::HasDiscardableImages(
    gfx::ContentColorUsage* content_color_usage) const {}

DrawImageOp::~DrawImageOp() = default;

DrawImageRectOp::DrawImageRectOp() :{}

DrawImageRectOp::DrawImageRectOp(const PaintImage& image,
                                 const SkRect& src,
                                 const SkRect& dst,
                                 SkCanvas::SrcRectConstraint constraint)
    :{}

DrawImageRectOp::DrawImageRectOp(const PaintImage& image,
                                 const SkRect& src,
                                 const SkRect& dst,
                                 const SkSamplingOptions& sampling,
                                 const PaintFlags* flags,
                                 SkCanvas::SrcRectConstraint constraint)
    :{}

bool DrawImageRectOp::HasDiscardableImages(
    gfx::ContentColorUsage* content_color_usage) const {}

DrawImageRectOp::~DrawImageRectOp() = default;

DrawRecordOp::DrawRecordOp(PaintRecord record, bool local_ctm)
    :{}

DrawRecordOp::~DrawRecordOp() = default;

size_t DrawRecordOp::AdditionalBytesUsed() const {}

size_t DrawRecordOp::AdditionalOpCount() const {}

DrawScrollingContentsOp::DrawScrollingContentsOp(
    ElementId scroll_element_id,
    scoped_refptr<DisplayItemList> display_item_list)
    :{}

DrawScrollingContentsOp::~DrawScrollingContentsOp() = default;

size_t DrawScrollingContentsOp::AdditionalBytesUsed() const {}

size_t DrawScrollingContentsOp::AdditionalOpCount() const {}

DrawVerticesOp::DrawVerticesOp() :{}

DrawVerticesOp::DrawVerticesOp(
    scoped_refptr<RefCountedBuffer<SkPoint>> vertices,
    scoped_refptr<RefCountedBuffer<SkPoint>> uvs,
    scoped_refptr<RefCountedBuffer<uint16_t>> indices,
    const PaintFlags& flags)
    :{}

DrawVerticesOp::~DrawVerticesOp() = default;

DrawSkottieOp::DrawSkottieOp(scoped_refptr<SkottieWrapper> skottie,
                             SkRect dst,
                             float t,
                             SkottieFrameDataMap images,
                             const SkottieColorMap& color_map,
                             SkottieTextPropertyValueMap text_map)
    :{}

DrawSkottieOp::DrawSkottieOp() :{}

DrawSkottieOp::~DrawSkottieOp() = default;

bool DrawSkottieOp::HasDiscardableImages(
    gfx::ContentColorUsage* content_color_usage) const {}

DrawTextBlobOp::DrawTextBlobOp() :{}

DrawTextBlobOp::DrawTextBlobOp(sk_sp<SkTextBlob> blob,
                               SkScalar x,
                               SkScalar y,
                               const PaintFlags& flags)
    :{}

DrawTextBlobOp::DrawTextBlobOp(sk_sp<SkTextBlob> blob,
                               SkScalar x,
                               SkScalar y,
                               NodeId node_id,
                               const PaintFlags& flags)
    :{}

DrawTextBlobOp::~DrawTextBlobOp() = default;

DrawSlugOp::DrawSlugOp() :{}

DrawSlugOp::DrawSlugOp(sk_sp<sktext::gpu::Slug> slug, const PaintFlags& flags)
    :{}

DrawSlugOp::~DrawSlugOp() = default;

SaveLayerFiltersOp::SaveLayerFiltersOp(base::span<sk_sp<PaintFilter>> filters,
                                       const PaintFlags& flags)
    :{}

SaveLayerFiltersOp::SaveLayerFiltersOp() :{}

SaveLayerFiltersOp::~SaveLayerFiltersOp() = default;

bool AreLiteOpsEnabled() {}

}  // namespace cc