Go to the source code of this file.
◆ create_BC1_block()
static void create_BC1_block |
( |
BC1Block * |
block, |
|
|
bool |
transparent |
|
) |
| |
|
static |
Definition at line 59 of file bc1_transparency.cpp.
59 {
60 unsigned int byte;
61
62 if (transparent) {
66
67 byte = (0x0 << 0) | (0x2 << 2) | (0x3 << 4) | (0x1 << 6);
68 } else {
72
73 byte = (0x1 << 0) | (0x3 << 2) | (0x2 << 4) | (0x0 << 6);
74 }
75
76 block->
fIndices = (
byte << 24) | (
byte << 16) | (
byte << 8) |
byte;
77}
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
static uint16_t to565(SkColor col)
◆ data_to_img()
Definition at line 106 of file bc1_transparency.cpp.
107 {
108 if (direct) {
111 } else {
114 }
115}
SK_API sk_sp< SkImage > TextureFromCompressedTextureData(GrDirectContext *direct, sk_sp< SkData > data, int width, int height, SkTextureCompressionType type, skgpu::Mipmapped mipmapped=skgpu::Mipmapped::kNo, GrProtected isProtected=GrProtected::kNo)
SK_API sk_sp< SkImage > RasterFromCompressedTextureData(sk_sp< SkData > data, int width, int height, SkTextureCompressionType type)
◆ draw_image()
Definition at line 117 of file bc1_transparency.cpp.
117 {
118
119 bool isCompressed = false;
125 }
126
128
129 if (!isCompressed) {
132
137
139 }
140}
constexpr SkColor SK_ColorRED
static SkImage_Base * as_IB(SkImage *image)
const GrCaps * caps() const
bool isFormatCompressed(const GrBackendFormat &format) const
GrImageContextPriv priv()
const GrBackendFormat & backendFormat() const
void drawRect(const SkRect &rect, const SkPaint &paint)
virtual GrRecordingContext * recordingContext() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
virtual GrImageContext * context() const
virtual bool isTextureBacked() const =0
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
void setStrokeWidth(SkScalar width)
GrTextureProxy * GetTextureImageProxy(SkImage *image, GrRecordingContext *rContext)
void outset(float dx, float dy)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
◆ make_compressed_data()
Definition at line 81 of file bc1_transparency.cpp.
81 {
83
85 nullptr, false);
86
89
93
96
97 for (
int y = 0;
y < numYBlocks; ++
y) {
98 for (
int x = 0;
x < numXBlocks; ++
x) {
99 dstBlocks[
y*numXBlocks +
x] = (
y < numYBlocks/2) ? transBlock : opaqueBlock;
100 }
101 }
102
103 return tmp;
104}
size_t SkCompressedDataSize(SkTextureCompressionType type, SkISize dimensions, TArray< size_t > *individualMipOffsets, bool mipmapped)
static int num_4x4_blocks(int size)
static void create_BC1_block(BC1Block *block, bool transparent)
static sk_sp< SkData > MakeUninitialized(size_t length)
◆ num_4x4_blocks()
static int num_4x4_blocks |
( |
int |
size | ) |
|
|
static |
◆ to565()
static uint16_t to565 |
( |
SkColor |
col | ) |
|
|
static |
Definition at line 36 of file bc1_transparency.cpp.
36 {
40
41 return (r5 << 11) | (g6 << 5) | b5;
42}
#define SkColorGetR(color)
#define SkColorGetG(color)
#define SkColorGetB(color)
static U8CPU SkMulDiv255Round(U16CPU a, U16CPU b)
◆ kImgHeight
constexpr int kImgHeight = 8 |
|
constexpr |
◆ kImgWidth
constexpr int kImgWidth = 16 |
|
constexpr |
◆ kPad