chromium/third_party/skia/src/gpu/DataUtils.cpp

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

#include "src/gpu/DataUtils.h"

#include "include/core/SkTextureCompressionType.h"
#include "include/gpu/GpuTypes.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMath.h"
#include "include/private/base/SkTPin.h"
#include "include/private/base/SkTemplates.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkCompressedDataUtils.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkTraceEvent.h"

#include <algorithm>
#include <cstdint>
#include <cstring>

usingnamespaceskia_private;

namespace skgpu {

struct ETC1Block {};

constexpr uint32_t kDiffBit =; // set -> differential; not-set -> individual

static inline int extend_5To8bits(int b) {}

static const int kNumETC1ModifierTables =;
static const int kNumETC1PixelIndices =;

// The index of each row in this table is the ETC1 table codeword
// The index of each column in this table is the ETC1 pixel index value
static const int kETC1ModifierTables[kNumETC1ModifierTables][kNumETC1PixelIndices] =;

// Evaluate one of the entries in 'kModifierTables' to see how close it can get (r8,g8,b8) to
// the original color (rOrig, gOrib, bOrig).
static int test_table_entry(int rOrig, int gOrig, int bOrig,
                            int r8, int g8, int b8,
                            int table, int offset) {}

// Create an ETC1 compressed block that is filled with 'col'
static void create_etc1_block(SkColor col, ETC1Block* block) {}

static int num_4x4_blocks(int size) {}

static int num_ETC1_blocks(int w, int h) {}

struct BC1Block {};

static uint16_t to565(SkColor col) {}

// Create a BC1 compressed block that has two colors but is initialized to 'col0'
static void create_BC1_block(SkColor col0, SkColor col1, BC1Block* block) {}

size_t NumCompressedBlocks(SkTextureCompressionType type, SkISize baseDimensions) {}

size_t CompressedRowBytes(SkTextureCompressionType type, int width) {}

SkISize CompressedDimensions(SkTextureCompressionType type, SkISize baseDimensions) {}

SkISize CompressedDimensionsInBlocks(SkTextureCompressionType type, SkISize baseDimensions) {}

// Fill in 'dest' with ETC1 blocks derived from 'colorf'
static void fillin_ETC1_with_color(SkISize dimensions, const SkColor4f& colorf, char* dest) {}

// Fill in 'dest' with BC1 blocks derived from 'colorf'
static void fillin_BC1_with_color(SkISize dimensions, const SkColor4f& colorf, char* dest) {}

void FillInCompressedData(SkTextureCompressionType type,
                          SkISize dimensions,
                          skgpu::Mipmapped mipmapped,
                          char* dstPixels,
                          const SkColor4f& colorf) {}

} // namespace skgpu