Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: src/utils/SkTextureCompressor_ASTC.cpp

Issue 443303006: Pass a struct of functions instead of a function to the compressed blitter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/utils/SkTextureCompressor_Blitter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTextureCompressor_ASTC.cpp
diff --git a/src/utils/SkTextureCompressor_ASTC.cpp b/src/utils/SkTextureCompressor_ASTC.cpp
index 816d2f1860cddb493f16afdcd2b969ff1385bb8f..25d87fd28eaadb3855ba974017c12c1cc7194a07 100644
--- a/src/utils/SkTextureCompressor_ASTC.cpp
+++ b/src/utils/SkTextureCompressor_ASTC.cpp
@@ -1991,6 +1991,23 @@ static void decompress_astc_block(uint8_t* dst, int dstRowBytes,
}
}
+// This is the type passed as the CompressorType argument of the compressed
+// blitter for the ASTC format. The static functions required to be in this
+// struct are documented in SkTextureCompressor_Blitter.h
+struct CompressorASTC {
+ static inline void CompressA8Vertical(uint8_t* dst, const uint8_t* src) {
+ compress_a8_astc_block<GetAlphaTranspose>(&dst, src, 12);
+ }
+
+ static inline void CompressA8Horizontal(uint8_t* dst, const uint8_t* src,
+ int srcRowBytes) {
+ compress_a8_astc_block<GetAlpha>(&dst, src, srcRowBytes);
+ }
+
+ static inline void UpdateBlock(uint8_t* dst, const uint8_t* src) {
+ }
+};
+
////////////////////////////////////////////////////////////////////////////////
namespace SkTextureCompressor {
@@ -2030,7 +2047,7 @@ SkBlitter* CreateASTCBlitter(int width, int height, void* outputBuffer,
}
return allocator->createT<
- SkTCompressedAlphaBlitter<12, 16, CompressA8ASTCBlockVertical>, int, int, void* >
+ SkTCompressedAlphaBlitter<12, 16, CompressorASTC>, int, int, void* >
(width, height, outputBuffer);
}
« no previous file with comments | « no previous file | src/utils/SkTextureCompressor_Blitter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698