#include "src/core/SkPictureData.h"
#include "include/core/SkFlattenable.h"
#include "include/core/SkFontMgr.h"
#include "include/core/SkSerialProcs.h"
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/core/SkTypeface.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkTFitsIn.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkAutoMalloc.h"
#include "src/core/SkPicturePriv.h"
#include "src/core/SkPictureRecord.h"
#include "src/core/SkPtrRecorder.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkStreamPriv.h"
#include "src/core/SkTHash.h"
#include "src/core/SkTextBlobPriv.h"
#include "src/core/SkVerticesPriv.h"
#include "src/core/SkWriteBuffer.h"
#include <cstring>
#include <utility>
usingnamespaceskia_private;
template <typename T> int SafeCount(const T* obj) { … }
SkPictureData::SkPictureData(const SkPictInfo& info)
: … { … }
void SkPictureData::initForPlayback() const { … }
SkPictureData::SkPictureData(const SkPictureRecord& record,
const SkPictInfo& info)
: … { … }
static size_t compute_chunk_size(SkFlattenable::Factory* array, int count) { … }
static void write_tag_size(SkWriteBuffer& buffer, uint32_t tag, size_t size) { … }
static void write_tag_size(SkWStream* stream, uint32_t tag, size_t size) { … }
void SkPictureData::WriteFactories(SkWStream* stream, const SkFactorySet& rec) { … }
void SkPictureData::WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec,
const SkSerialProcs& procs) { … }
void SkPictureData::flattenToBuffer(SkWriteBuffer& buffer, bool textBlobsOnly) const { … }
static SkSerialProcs skip_typeface_proc(const SkSerialProcs& procs) { … }
void SkPictureData::serialize(SkWStream* stream, const SkSerialProcs& procs,
SkRefCntSet* topLevelTypeFaceSet, bool textBlobsOnly) const { … }
void SkPictureData::flatten(SkWriteBuffer& buffer) const { … }
bool SkPictureData::parseStreamTag(SkStream* stream,
uint32_t tag,
uint32_t size,
const SkDeserialProcs& procs,
SkTypefacePlayback* topLevelTFPlayback,
int recursionLimit) { … }
static sk_sp<SkImage> create_image_from_buffer(SkReadBuffer& buffer) { … }
static sk_sp<SkDrawable> create_drawable_from_buffer(SkReadBuffer& buffer) { … }
template <typename T, typename U>
bool new_array_from_buffer(SkReadBuffer& buffer, uint32_t inCount,
TArray<sk_sp<T>>& array, sk_sp<U> (*factory)(SkReadBuffer&)) { … }
void SkPictureData::parseBufferTag(SkReadBuffer& buffer, uint32_t tag, uint32_t size) { … }
SkPictureData* SkPictureData::CreateFromStream(SkStream* stream,
const SkPictInfo& info,
const SkDeserialProcs& procs,
SkTypefacePlayback* topLevelTFPlayback,
int recursionLimit) { … }
SkPictureData* SkPictureData::CreateFromBuffer(SkReadBuffer& buffer,
const SkPictInfo& info) { … }
bool SkPictureData::parseStream(SkStream* stream,
const SkDeserialProcs& procs,
SkTypefacePlayback* topLevelTFPlayback,
int recursionLimit) { … }
bool SkPictureData::parseBuffer(SkReadBuffer& buffer) { … }
const SkPaint* SkPictureData::optionalPaint(SkReadBuffer* reader) const { … }
const SkPaint& SkPictureData::requiredPaint(SkReadBuffer* reader) const { … }