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

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: 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
Index: src/utils/SkTextureCompressor_LATC.cpp
diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp
index 0b9cf17ad635b0f7470f75047d7b975be6b51875..b8b138eee7584666fda61cd4d28eacdba177bc46 100644
--- a/src/utils/SkTextureCompressor_LATC.cpp
+++ b/src/utils/SkTextureCompressor_LATC.cpp
@@ -414,6 +414,20 @@ void decompress_latc_block(uint8_t* dst, int dstRowBytes, const uint8_t* src) {
}
}
+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 +458,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)

Powered by Google App Engine
This is Rietveld 408576698