42 return (c << 3) | (c >> 2);
46 static const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 };
63 { 33, 106, -33, -106 },
64 { 47, 183, -47, -183 }
68 return ((
size + 3) & ~3) >> 2;
101 for (
int y = 0;
y < numYBlocks; ++
y) {
102 for (
int x = 0;
x < numXBlocks; ++
x) {
103 const ETC1Block* curBlock1 = &srcBlocks[
y * numXBlocks +
x];
128 int tableIndex0 = (high >> 5) & 0x7;
129 int tableIndex1 = (high >> 2) & 0x7;
130 const int* tables[2] = {
137 for (
int i = 0;
i < 4; ++
i, ++baseShift) {
138 for (
int j = 0; j < 4; ++j) {
146 int pixelIndex = ((low >> (baseShift+(j*4))) & 0x1) |
147 (low >> (baseShift+(j*4)+15) & 0x2);
149 SkASSERT(subBlockIndex == 0 || subBlockIndex == 1);
150 SkASSERT(pixelIndex >= 0 && pixelIndex < 4);
152 int delta = tables[subBlockIndex][pixelIndex];
198 for (
int y = 0;
y < numYBlocks; ++
y) {
199 for (
int x = 0;
x < numXBlocks; ++
x) {
200 const BC1Block* curBlock = &srcBlocks[
y * numXBlocks +
x];
219 for (
int i = 0;
i < 4; ++
i) {
220 for (
int j = 0; j < 4; ++j, shift += 2) {
227 int index = (curBlock->
fIndices >> shift) & 0x3;
243 const uint8_t* bytes =
data->bytes();
244 switch (compressionType) {
245 case Type::kNone:
return false;
248 case Type::kBC1_RGBA8_UNORM:
return decompress_bc1(dimensions, bytes,
false,
dst);
256 SkASSERT(!individualMipOffsets || individualMipOffsets->
empty());
258 int numMipLevels = 1;
263 size_t totalSize = 0;
270 for (
int i = 0;
i < numMipLevels; ++
i) {
274 if (individualMipOffsets) {
275 individualMipOffsets->
push_back(totalSize);
279 totalSize += numBlocks *
sizeof(
ETC1Block);
281 dimensions = {
std::max(1, dimensions.width()/2),
std::max(1, dimensions.height()/2)};
304 SkISize dimensions,
bool mipmapped) {
static const uint16_t rgb565[kNumPixels]
static unsigned SkB16ToB32(unsigned b)
static unsigned SkG16ToG32(unsigned g)
static unsigned SkR16ToR32(unsigned r)
#define SkGetPackedB32(packed)
#define SkGetPackedR32(packed)
#define SkGetPackedA32(packed)
#define SkGetPackedG32(packed)
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
bool SkDecompress(sk_sp< SkData > data, SkISize dimensions, SkTextureCompressionType compressionType, SkBitmap *dst)
static int extend_5To8bits(int b)
static SkPMColor lerp(float t, SkPMColor col0, SkPMColor col1)
static const int kNumETC1PixelIndices
static bool decompress_bc1(SkISize dimensions, const uint8_t *srcData, bool isOpaque, SkBitmap *dst)
static int xy_to_subblock_index(int x, int y, bool flip)
static int num_4x4_blocks(int size)
static SkPMColor add_delta_and_clamp(const IColor &col, int delta)
size_t SkCompressedFormatDataSize(SkTextureCompressionType compressionType, SkISize dimensions, bool mipmapped)
constexpr uint32_t kDiffBit
static const int kNumETC1ModifierTables
static bool decompress_etc1(SkISize dimensions, const uint8_t *srcData, SkBitmap *dst)
size_t SkCompressedDataSize(SkTextureCompressionType type, SkISize dimensions, TArray< size_t > *individualMipOffsets, bool mipmapped)
static int extend_4To8bits(int b)
static const int kETC1ModifierTables[kNumETC1ModifierTables][kNumETC1PixelIndices]
static SkPMColor from565(uint16_t rgb565)
static int extend_5plus3To8Bits(int base, int diff)
constexpr uint32_t kFlipBit
size_t SkCompressedBlockSize(SkTextureCompressionType type)
static uint32_t SkBSwap32(uint32_t v)
#define SkScalarRoundToInt(x)
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
static constexpr bool SkToBool(const T &x)
static int ComputeLevelCount(int baseWidth, int baseHeight)
static const int kLookup[8]
static float max(float r, float g, float b)
PODArray< SkColor > colors
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr int32_t width() const
constexpr int32_t height() const
std::shared_ptr< const fml::Mapping > data