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

Unified Diff: src/effects/gradients/SkLinearGradient.cpp

Issue 21122005: fold SK_CPU_HAS_CONDITION_INSTR through as always defined (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: typo Created 7 years, 5 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/core/SkMathPriv.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 4bc697d9047c425889a6900307d4b5014a9122e5..2f56cb49ca21c2b4443663a5259def64bf31f24d 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -23,26 +23,17 @@ static inline int repeat_8bits(int x) {
#endif
static inline int mirror_bits(int x, const int bits) {
-#ifdef SK_CPU_HAS_CONDITIONAL_INSTR
- if (x & (1 << bits))
+ if (x & (1 << bits)) {
x = ~x;
+ }
return x & ((1 << bits) - 1);
-#else
- int s = x << (31 - bits) >> 31;
- return (x ^ s) & ((1 << bits) - 1);
-#endif
}
static inline int mirror_8bits(int x) {
-#ifdef SK_CPU_HAS_CONDITIONAL_INSTR
if (x & 256) {
x = ~x;
}
return x & 255;
-#else
- int s = x << 23 >> 31;
- return (x ^ s) & 0xFF;
-#endif
}
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
« no previous file with comments | « src/core/SkMathPriv.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698