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

Unified Diff: include/core/SkTypes.h

Issue 325733004: Add texture compression utility (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Code review changes Created 6 years, 6 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: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 15de8a4937b37cbd3456a91b52c013c47047068c..eeee33a48ac9d34e0048ad5441b7e218c763a7b4 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -354,6 +354,12 @@ template <typename T> inline T SkTAbs(T value) {
return value;
}
+// Absolute difference between two values. More correct than SkTAbs(a - b)
+// because it works on unsigned values.
+template <typename T> inline T SkTAbsDiff(const T &a, const T &b) {
+ return (a > b)? (a - b) : (b - a);
+}
+
static inline int32_t SkMax32(int32_t a, int32_t b) {
if (a < b)
a = b;
« no previous file with comments | « gyp/utils.gypi ('k') | src/utils/SkTextureCompressor.h » ('j') | src/utils/SkTextureCompressor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698