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

/*
 * Copyright 2008 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "include/core/SkBitmap.h"

#include "include/core/SkColorSpace.h" // IWYU pragma: keep
#include "include/core/SkColorType.h"
#include "include/core/SkImage.h"
#include "include/core/SkMallocPixelRef.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPixelRef.h"
#include "include/core/SkRect.h"
#include "include/core/SkShader.h"
#include "include/core/SkTileMode.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkTFitsIn.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "src/core/SkConvertPixels.h"
#include "src/core/SkImageInfoPriv.h"
#include "src/core/SkImagePriv.h"
#include "src/core/SkMask.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkPixelRefPriv.h"
#include "src/core/SkWritePixelsRec.h"
#include "src/shaders/SkImageShader.h"

#include <cstring>
#include <utility>
class SkMaskFilter;

static bool reset_return_false(SkBitmap* bm) {}

SkBitmap::SkBitmap() {}

SkBitmap::SkBitmap(const SkBitmap& src)
    :{}

SkBitmap::SkBitmap(SkBitmap&& other)
    :{}

SkBitmap::~SkBitmap() {}

SkBitmap& SkBitmap::operator=(const SkBitmap& src) {}

SkBitmap& SkBitmap::operator=(SkBitmap&& other) {}

void SkBitmap::swap(SkBitmap& other) {}

void SkBitmap::reset() {}

void SkBitmap::getBounds(SkRect* bounds) const {}

void SkBitmap::getBounds(SkIRect* bounds) const {}

SkColorSpace* SkBitmap::colorSpace() const {}

sk_sp<SkColorSpace> SkBitmap::refColorSpace() const {}

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

bool SkBitmap::setInfo(const SkImageInfo& info, size_t rowBytes) {}

bool SkBitmap::setAlphaType(SkAlphaType newAlphaType) {}

void SkBitmap::setColorSpace(sk_sp<SkColorSpace> newColorSpace) {}

SkIPoint SkBitmap::pixelRefOrigin() const {}

void SkBitmap::setPixelRef(sk_sp<SkPixelRef> pr, int dx, int dy) {}

void SkBitmap::setPixels(void* p) {}

bool SkBitmap::tryAllocPixels(Allocator* allocator) {}

bool SkBitmap::tryAllocN32Pixels(int width, int height, bool isOpaque) {}

void SkBitmap::allocN32Pixels(int width, int height, bool isOpaque) {}

void SkBitmap::allocPixels() {}

void SkBitmap::allocPixels(Allocator* allocator) {}

void SkBitmap::allocPixelsFlags(const SkImageInfo& info, uint32_t flags) {}

void SkBitmap::allocPixels(const SkImageInfo& info, size_t rowBytes) {}

void SkBitmap::allocPixels(const SkImageInfo& info) {}

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

bool SkBitmap::tryAllocPixels(const SkImageInfo& requestedInfo, size_t rowBytes) {}

bool SkBitmap::tryAllocPixelsFlags(const SkImageInfo& requestedInfo, uint32_t allocFlags) {}

static void invoke_release_proc(void (*proc)(void* pixels, void* ctx), void* pixels, void* ctx) {}

bool SkBitmap::installPixels(const SkImageInfo& requestedInfo, void* pixels, size_t rb,
                             void (*releaseProc)(void* addr, void* context), void* context) {}

bool SkBitmap::installPixels(const SkPixmap& pixmap) {}

bool SkBitmap::installMaskPixels(SkMaskBuilder& mask) {}

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

uint32_t SkBitmap::getGenerationID() const {}

void SkBitmap::notifyPixelsChanged() const {}

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

/** We explicitly use the same allocator for our pixels that SkMask does,
 so that we can freely assign memory allocated by one class to the other.
 */
bool SkBitmap::HeapAllocator::allocPixelRef(SkBitmap* dst) {}

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

bool SkBitmap::isImmutable() const {}

void SkBitmap::setImmutable() {}

void* SkBitmap::getAddr(int x, int y) const {}

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

void SkBitmap::erase(SkColor4f c, const SkIRect& area) const {}

void SkBitmap::erase(SkColor c, const SkIRect& area) const {}

void SkBitmap::eraseColor(SkColor4f c) const {}

void SkBitmap::eraseColor(SkColor c) const {}

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

bool SkBitmap::extractSubset(SkBitmap* result, const SkIRect& subset) const {}

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

bool SkBitmap::readPixels(const SkImageInfo& requestedDstInfo, void* dstPixels, size_t dstRB,
                          int x, int y) const {}

bool SkBitmap::readPixels(const SkPixmap& dst, int srcX, int srcY) const {}

bool SkBitmap::writePixels(const SkPixmap& src, int dstX, int dstY) {}

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

static bool GetBitmapAlpha(const SkBitmap& src, uint8_t* SK_RESTRICT alpha, int alphaRowBytes) {}

bool SkBitmap::extractAlpha(SkBitmap* dst, const SkPaint* paint,
                            Allocator *allocator, SkIPoint* offset) const {}

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

#ifdef SK_DEBUG
void SkBitmap::validate() const {}
#endif

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

bool SkBitmap::peekPixels(SkPixmap* pmap) const {}

sk_sp<SkImage> SkBitmap::asImage() const {}

sk_sp<SkShader> SkBitmap::makeShader(const SkSamplingOptions& sampling,
                                     const SkMatrix& lm) const {}

sk_sp<SkShader> SkBitmap::makeShader(const SkSamplingOptions& sampling,
                                     const SkMatrix* lm) const {}

sk_sp<SkShader> SkBitmap::makeShader(SkTileMode tmx, SkTileMode tmy,
                                     const SkSamplingOptions& sampling,
                                     const SkMatrix& lm) const {}

sk_sp<SkShader> SkBitmap::makeShader(SkTileMode tmx, SkTileMode tmy,
                                     const SkSamplingOptions& sampling,
                                     const SkMatrix* lm) const {}