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

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

#include "src/core/SkGlyph.h"

#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkPicture.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSerialProcs.h"
#include "include/core/SkSpan.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTFitsIn.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkArenaAlloc.h"
#include "src/base/SkBezierCurves.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkScalerContext.h"
#include "src/core/SkWriteBuffer.h"
#include "src/text/StrikeForGPU.h"

#include <cstring>
#include <optional>
#include <tuple>
#include <utility>

usingnamespaceskglyph;
usingnamespacesktext;

// -- SkPictureBackedGlyphDrawable -----------------------------------------------------------------
sk_sp<SkPictureBackedGlyphDrawable>
SkPictureBackedGlyphDrawable::MakeFromBuffer(SkReadBuffer& buffer) {}

void SkPictureBackedGlyphDrawable::FlattenDrawable(SkWriteBuffer& buffer, SkDrawable* drawable) {}

SkPictureBackedGlyphDrawable::SkPictureBackedGlyphDrawable(sk_sp<SkPicture> picture)
        :{}

SkRect SkPictureBackedGlyphDrawable::onGetBounds() {}

size_t SkPictureBackedGlyphDrawable::onApproximateBytesUsed() {}

void SkPictureBackedGlyphDrawable::onDraw(SkCanvas* canvas) {}

//-- SkGlyph ---------------------------------------------------------------------------------------
std::optional<SkGlyph> SkGlyph::MakeFromBuffer(SkReadBuffer& buffer) {}

SkGlyph::SkGlyph(const SkGlyph&) = default;
SkGlyph& SkGlyph::operator=(const SkGlyph&) = default;
SkGlyph::SkGlyph(SkGlyph&&) = default;
SkGlyph& SkGlyph::operator=(SkGlyph&&) = default;
SkGlyph::~SkGlyph() = default;

SkMask SkGlyph::mask() const {}

SkMask SkGlyph::mask(SkPoint position) const {}

void SkGlyph::zeroMetrics() {}

static size_t bits_to_bytes(size_t bits) {}

static size_t format_alignment(SkMask::Format format) {}

static size_t format_rowbytes(int width, SkMask::Format format) {}

size_t SkGlyph::formatAlignment() const {}

size_t SkGlyph::allocImage(SkArenaAlloc* alloc) {}

bool SkGlyph::setImage(SkArenaAlloc* alloc, SkScalerContext* scalerContext) {}

bool SkGlyph::setImage(SkArenaAlloc* alloc, const void* image) {}

size_t SkGlyph::setMetricsAndImage(SkArenaAlloc* alloc, const SkGlyph& from) {}

size_t SkGlyph::rowBytes() const {}

size_t SkGlyph::rowBytesUsingFormat(SkMask::Format format) const {}

size_t SkGlyph::imageSize() const {}

void SkGlyph::installPath(SkArenaAlloc* alloc, const SkPath* path, bool hairline) {}

bool SkGlyph::setPath(SkArenaAlloc* alloc, SkScalerContext* scalerContext) {}

bool SkGlyph::setPath(SkArenaAlloc* alloc, const SkPath* path, bool hairline) {}

const SkPath* SkGlyph::path() const {}

bool SkGlyph::pathIsHairline() const {}

void SkGlyph::installDrawable(SkArenaAlloc* alloc, sk_sp<SkDrawable> drawable) {}

bool SkGlyph::setDrawable(SkArenaAlloc* alloc, SkScalerContext* scalerContext) {}

bool SkGlyph::setDrawable(SkArenaAlloc* alloc, sk_sp<SkDrawable> drawable) {}

SkDrawable* SkGlyph::drawable() const {}

void SkGlyph::flattenMetrics(SkWriteBuffer& buffer) const {}

void SkGlyph::flattenImage(SkWriteBuffer& buffer) const {}

size_t SkGlyph::addImageFromBuffer(SkReadBuffer& buffer, SkArenaAlloc* alloc) {}

void SkGlyph::flattenPath(SkWriteBuffer& buffer) const {}

size_t SkGlyph::addPathFromBuffer(SkReadBuffer& buffer, SkArenaAlloc* alloc) {}

void SkGlyph::flattenDrawable(SkWriteBuffer& buffer) const {}

size_t SkGlyph::addDrawableFromBuffer(SkReadBuffer& buffer, SkArenaAlloc* alloc) {}

static std::tuple<SkScalar, SkScalar> calculate_path_gap(
        SkScalar topOffset, SkScalar bottomOffset, const SkPath& path) {}

void SkGlyph::ensureIntercepts(const SkScalar* bounds, SkScalar scale, SkScalar xPos,
                               SkScalar* array, int* count, SkArenaAlloc* alloc) {}

namespace {
uint32_t init_actions(const SkGlyph& glyph) {}
}  // namespace

// -- SkGlyphDigest --------------------------------------------------------------------------------
SkGlyphDigest::SkGlyphDigest(size_t index, const SkGlyph& glyph)
        :{}

void SkGlyphDigest::setActionFor(skglyph::ActionType actionType,
                                 SkGlyph* glyph,
                                 StrikeForGPU* strike) {}

bool SkGlyphDigest::FitsInAtlas(const SkGlyph& glyph) {}

// -- SkGlyphPositionRoundingSpec ------------------------------------------------------------------
SkVector SkGlyphPositionRoundingSpec::HalfAxisSampleFreq(
        bool isSubpixel, SkAxisAlignment axisAlignment) {}

SkIPoint SkGlyphPositionRoundingSpec::IgnorePositionMask(
        bool isSubpixel, SkAxisAlignment axisAlignment) {}

SkIPoint SkGlyphPositionRoundingSpec::IgnorePositionFieldMask(bool isSubpixel,
                                                              SkAxisAlignment axisAlignment) {}

SkGlyphPositionRoundingSpec::SkGlyphPositionRoundingSpec(
        bool isSubpixel, SkAxisAlignment axisAlignment)
    :{}