#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 = …;
static inline int extend_5To8bits(int b) { … }
static const int kNumETC1ModifierTables = …;
static const int kNumETC1PixelIndices = …;
static const int kETC1ModifierTables[kNumETC1ModifierTables][kNumETC1PixelIndices] = …;
static int test_table_entry(int rOrig, int gOrig, int bOrig,
int r8, int g8, int b8,
int table, int offset) { … }
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) { … }
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) { … }
static void fillin_ETC1_with_color(SkISize dimensions, const SkColor4f& colorf, char* dest) { … }
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) { … }
}