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

Unified Diff: src/utils/SkTextureCompressor_LATC.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_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);

Powered by Google App Engine
This is Rietveld 408576698