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

Unified Diff: src/utils/SkTextureCompressor_LATC.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 | « src/utils/SkTextureCompressor_Blitter.h ('k') | src/utils/SkTextureCompressor_R11EAC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTextureCompressor_LATC.cpp
diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp
index 0b9cf17ad635b0f7470f75047d7b975be6b51875..c9bf89ea4c1bc648a194a1ad5ccc3517ccd0cf41 100644
--- a/src/utils/SkTextureCompressor_LATC.cpp
+++ b/src/utils/SkTextureCompressor_LATC.cpp
@@ -414,6 +414,23 @@ void decompress_latc_block(uint8_t* dst, int dstRowBytes, const uint8_t* src) {
}
}
+// This is the type passed as the CompressorType argument of the compressed
+// blitter for the LATC format. The static functions required to be in this
+// struct are documented in SkTextureCompressor_Blitter.h
+struct CompressorLATC {
+ static inline void CompressA8Vertical(uint8_t* dst, const uint8_t block[]) {
+ compress_a8_latc_block<PackColumnMajor>(&dst, block, 4);
+ }
+
+ static inline void CompressA8Horizontal(uint8_t* dst, const uint8_t* src,
+ int srcRowBytes) {
+ compress_a8_latc_block<PackRowMajor>(&dst, src, srcRowBytes);
+ }
+
+ static inline void UpdateBlock(uint8_t* dst, const uint8_t* src) {
+ }
+};
+
////////////////////////////////////////////////////////////////////////////////
namespace SkTextureCompressor {
@@ -444,7 +461,7 @@ SkBlitter* CreateLATCBlitter(int width, int height, void* outputBuffer,
sk_bzero(outputBuffer, width * height / 2);
return allocator->createT<
- SkTCompressedAlphaBlitter<4, 8, CompressA8LATCBlockVertical>, int, int, void* >
+ SkTCompressedAlphaBlitter<4, 8, CompressorLATC>, int, int, void* >
(width, height, outputBuffer);
#elif COMPRESS_LATC_SLOW
// TODO (krajcevski)
« no previous file with comments | « src/utils/SkTextureCompressor_Blitter.h ('k') | src/utils/SkTextureCompressor_R11EAC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698