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

Unified Diff: src/utils/SkTextureCompressor_R11EAC.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_LATC.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTextureCompressor_R11EAC.cpp
diff --git a/src/utils/SkTextureCompressor_R11EAC.cpp b/src/utils/SkTextureCompressor_R11EAC.cpp
index 1d2b8e54aa84899d93347cb9625d55f4d05597be..5ccd50bd324fb726227247d29738f2d69d0b2be4 100644
--- a/src/utils/SkTextureCompressor_R11EAC.cpp
+++ b/src/utils/SkTextureCompressor_R11EAC.cpp
@@ -590,6 +590,23 @@ static void decompress_r11_eac_block(uint8_t* dst, int dstRowBytes, const uint8_
}
}
+// This is the type passed as the CompressorType argument of the compressed
+// blitter for the R11 EAC format. The static functions required to be in this
+// struct are documented in SkTextureCompressor_Blitter.h
+struct CompressorR11EAC {
+ static inline void CompressA8Vertical(uint8_t* dst, const uint8_t* src) {
+ compress_block_vertical(dst, src);
+ }
+
+ static inline void CompressA8Horizontal(uint8_t* dst, const uint8_t* src,
+ int srcRowBytes) {
+ *(reinterpret_cast<uint64_t*>(dst)) = compress_r11eac_block_fast(src, srcRowBytes);
+ }
+
+ static inline void UpdateBlock(uint8_t* dst, const uint8_t* src) {
+ }
+};
+
////////////////////////////////////////////////////////////////////////////////
namespace SkTextureCompressor {
@@ -628,7 +645,7 @@ SkBlitter* CreateR11EACBlitter(int width, int height, void* outputBuffer,
}
return allocator->createT<
- SkTCompressedAlphaBlitter<4, 8, compress_block_vertical>, int, int, void*>
+ SkTCompressedAlphaBlitter<4, 8, CompressorR11EAC>, int, int, void*>
(width, height, outputBuffer);
}
« no previous file with comments | « src/utils/SkTextureCompressor_LATC.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698