chromium/third_party/skia/src/core/SkReadBuffer.cpp

/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/core/SkReadBuffer.h"

#include "include/core/SkAlphaType.h"
#include "include/core/SkData.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageGenerator.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkM44.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkPoint3.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRegion.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTypeface.h"
#include "include/private/base/SkMalloc.h"
#include "src/base/SkAutoMalloc.h"
#include "src/base/SkMathPriv.h"
#include "src/base/SkSafeMath.h"
#include "src/core/SkMatrixPriv.h"
#include "src/core/SkMipmapBuilder.h"
#include "src/core/SkWriteBuffer.h"

#include <memory>
#include <optional>
#include <utility>

namespace {
    // This generator intentionally should always fail on all attempts to get its pixels,
    // simulating a bad or empty codec stream.
    class EmptyImageGenerator final : public SkImageGenerator {};

    static sk_sp<SkImage> MakeEmptyImage(int width, int height) {}

} // anonymous namespace

void SkReadBuffer::setMemory(const void* data, size_t size) {}

void SkReadBuffer::setInvalid() {}

const void* SkReadBuffer::skip(size_t size) {}

const void* SkReadBuffer::skip(size_t count, size_t size) {}

void SkReadBuffer::setDeserialProcs(const SkDeserialProcs& procs) {}

bool SkReadBuffer::readBool() {}

SkColor SkReadBuffer::readColor() {}

int32_t SkReadBuffer::readInt() {}

SkScalar SkReadBuffer::readScalar() {}

uint32_t SkReadBuffer::readUInt() {}

int32_t SkReadBuffer::read32() {}

uint8_t SkReadBuffer::peekByte() {}

bool SkReadBuffer::readPad32(void* buffer, size_t bytes) {}

const char* SkReadBuffer::readString(size_t* len) {}

void SkReadBuffer::readString(SkString* string) {}

void SkReadBuffer::readColor4f(SkColor4f* color) {}

void SkReadBuffer::readPoint(SkPoint* point) {}

void SkReadBuffer::readPoint3(SkPoint3* point) {}

void SkReadBuffer::read(SkM44* matrix) {}

void SkReadBuffer::readMatrix(SkMatrix* matrix) {}

void SkReadBuffer::readIRect(SkIRect* rect) {}

void SkReadBuffer::readRect(SkRect* rect) {}

SkRect SkReadBuffer::readRect() {}

SkSamplingOptions SkReadBuffer::readSampling() {}

void SkReadBuffer::readRRect(SkRRect* rrect) {}

void SkReadBuffer::readRegion(SkRegion* region) {}

void SkReadBuffer::readPath(SkPath* path) {}

bool SkReadBuffer::readArray(void* value, size_t size, size_t elementSize) {}

bool SkReadBuffer::readByteArray(void* value, size_t size) {}

bool SkReadBuffer::readColorArray(SkColor* colors, size_t size) {}

bool SkReadBuffer::readColor4fArray(SkColor4f* colors, size_t size) {}

bool SkReadBuffer::readIntArray(int32_t* values, size_t size) {}

bool SkReadBuffer::readPointArray(SkPoint* points, size_t size) {}

bool SkReadBuffer::readScalarArray(SkScalar* values, size_t size) {}

const void* SkReadBuffer::skipByteArray(size_t* size) {}

sk_sp<SkData> SkReadBuffer::readByteArrayAsData() {}

uint32_t SkReadBuffer::getArrayCount() {}

static sk_sp<SkImage> deserialize_image(sk_sp<SkData> data, SkDeserialProcs dProcs,
                                        std::optional<SkAlphaType> alphaType) {}

static sk_sp<SkImage> add_mipmaps(sk_sp<SkImage> img, sk_sp<SkData> data,
                                  SkDeserialProcs dProcs, std::optional<SkAlphaType> alphaType) {}


// If we see a corrupt stream, we return null (fail). If we just fail trying to decode
// the image, we don't fail, but return a 1x1 empty image.
sk_sp<SkImage> SkReadBuffer::readImage() {}

sk_sp<SkTypeface> SkReadBuffer::readTypeface() {}

SkFlattenable* SkReadBuffer::readRawFlattenable() {}

SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {}

///////////////////////////////////////////////////////////////////////////////////////////////////

int32_t SkReadBuffer::checkInt(int32_t min, int32_t max) {}

SkLegacyFQ SkReadBuffer::checkFilterQuality() {}