Index: src/utils/SkTextureCompressor_LATC.cpp |
diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp |
index 5db0fc6c04e609c4ad3c72a0393a3ec9ee870e51..38eb6e512c75ed03cc85657bad503bfc10e220a7 100644 |
--- a/src/utils/SkTextureCompressor_LATC.cpp |
+++ b/src/utils/SkTextureCompressor_LATC.cpp |
@@ -428,7 +428,16 @@ bool CompressA8ToLATC(uint8_t* dst, const uint8_t* src, int width, int height, i |
} |
SkBlitter* CreateLATCBlitter(int width, int height, void* outputBuffer) { |
+ if ((width % 4) != 0 || (height % 4) != 0) { |
+ return NULL; |
+ } |
+ |
#if COMPRESS_LATC_FAST |
+ // Memset the output buffer to an encoding that decodes to zero... |
+ // In the case of LATC, if everything is zero, then LUM0 and LUM1 are also zero, |
+ // and they will only be non-zero (0xFF) if the index is 7. So bzero will do just fine. |
robertphillips
2014/08/06 20:54:49
// (8 bytes/block) * (w * h / 4*4) blocks = w * h
krajcevski
2014/08/06 22:42:00
Done.
|
+ sk_bzero(outputBuffer, width * height / 2); |
+ |
return new |
SkTCompressedAlphaBlitter<4, 8, CompressA8LATCBlockVertical> |
(width, height, outputBuffer); |