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

Unified Diff: src/utils/SkTextureCompressor_R11EAC.cpp

Issue 669243003: Add utils to better quantize grayscale values to three bit indices while (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update tests to reflect new qunatization method Created 6 years, 2 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') | src/utils/SkTextureCompressor_Utils.h » ('j') | 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 9996eb9596f5e71e7eb8d8c3d429f3034bd75da5..43226e0c99d75e2b22fabcdee498d7122bb50f39 100644
--- a/src/utils/SkTextureCompressor_R11EAC.cpp
+++ b/src/utils/SkTextureCompressor_R11EAC.cpp
@@ -7,6 +7,7 @@
#include "SkTextureCompressor.h"
#include "SkTextureCompressor_Blitter.h"
+#include "SkTextureCompressor_Utils.h"
#include "SkBlitter.h"
#include "SkEndian.h"
@@ -320,7 +321,7 @@ static bool compress_4x4_a8_to_64bit(uint8_t* dst, const uint8_t* src,
// Most of the voodoo in this function comes from Hacker's Delight, section 2-18
static inline uint32_t convert_indices(uint32_t x) {
// Take the top three bits...
- x = (x & 0xE0E0E0E0) >> 5;
+ x = SkTextureCompressor::ConvertToThreeBitIndex(x);
// Negate...
x = ~((0x80808080 - x) ^ 0x7F7F7F7F);
« no previous file with comments | « src/utils/SkTextureCompressor_LATC.cpp ('k') | src/utils/SkTextureCompressor_Utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698