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

Unified Diff: src/utils/SkTextureCompressor_R11EAC.cpp

Issue 446103002: Pass compressed blitters to our mask drawing algorithm (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_R11EAC.cpp
diff --git a/src/utils/SkTextureCompressor_R11EAC.cpp b/src/utils/SkTextureCompressor_R11EAC.cpp
index 7baa219a28de88d05e2a6966b85b9d45ab2534e6..1b0a705c10d7bff2dda78586a427162c38be1d84 100644
--- a/src/utils/SkTextureCompressor_R11EAC.cpp
+++ b/src/utils/SkTextureCompressor_R11EAC.cpp
@@ -609,6 +609,21 @@ bool CompressA8ToR11EAC(uint8_t* dst, const uint8_t* src, int width, int height,
}
SkBlitter* CreateR11EACBlitter(int width, int height, void* outputBuffer) {
+ if ((width % 4) != 0 || (height % 4) != 0) {
+ return NULL;
+ }
+
+ // Memset the output buffer to an encoding that decodes to zero...
robertphillips 2014/08/06 20:54:49 ASTC -> R11 ?
krajcevski 2014/08/06 22:42:00 Done.
+ // In the case of ASTC, if everything index is zero, then the interpolated value
+ // will decode to zero provided we have the right header. We use the encoding
+ // from recognizing all zero blocks from above.
+ const int nBlocks = (width * height / 16);
+ uint64_t *dst = reinterpret_cast<uint64_t *>(outputBuffer);
+ for (int i = 0; i < nBlocks; ++i) {
+ *dst = 0x0020000000002000ULL;
+ ++dst;
+ }
+
return new
SkTCompressedAlphaBlitter<4, 8, compress_block_vertical>
(width, height, outputBuffer);
« src/utils/SkTextureCompressor_LATC.cpp ('K') | « src/utils/SkTextureCompressor_LATC.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698