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

Unified Diff: src/utils/SkTextureCompressor_LATC.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 | « gyp/utils.gypi ('k') | src/utils/SkTextureCompressor_R11EAC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTextureCompressor_LATC.cpp
diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp
index 1e5e142ddb8d9911eb5de3f419b8f379f978a70f..937aec809e4c182bacd8bde581dc5fb8ae6536ec 100644
--- a/src/utils/SkTextureCompressor_LATC.cpp
+++ b/src/utils/SkTextureCompressor_LATC.cpp
@@ -7,6 +7,7 @@
#include "SkTextureCompressor_LATC.h"
#include "SkTextureCompressor_Blitter.h"
+#include "SkTextureCompressor_Utils.h"
#include "SkBlitter.h"
#include "SkEndian.h"
@@ -329,7 +330,7 @@ static inline uint32_t convert_index(uint32_t x) {
//
// This first operation takes the mapping from
// 0 1 2 3 4 5 6 7 --> 7 6 5 4 3 2 1 0
- x = 0x07070707 - ((x >> 5) & 0x07070707);
+ x = 0x07070707 - SkTextureCompressor::ConvertToThreeBitIndex(x);
// mask is 1 if index is non-zero
const uint32_t mask = (x | (x >> 1) | (x >> 2)) & 0x01010101;
« no previous file with comments | « gyp/utils.gypi ('k') | src/utils/SkTextureCompressor_R11EAC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698