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

Unified Diff: src/core/SkBitmapProcState_matrixProcs.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/Sk64.cpp ('k') | src/core/SkMath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_matrixProcs.cpp
diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp
index a3d2b08665335c5f1b345589ff4e5db82ca6dc78..70d367b8707659f17eee533f10ee317e38f3aab5 100644
--- a/src/core/SkBitmapProcState_matrixProcs.cpp
+++ b/src/core/SkBitmapProcState_matrixProcs.cpp
@@ -112,24 +112,12 @@ extern const SkBitmapProcState::MatrixProc RepeatX_RepeatY_Procs_neon[];
static inline U16CPU fixed_clamp(SkFixed x)
{
-#ifdef SK_CPU_HAS_CONDITIONAL_INSTR
- if (x < 0)
+ if (x < 0) {
x = 0;
- if (x >> 16)
+ }
+ if (x >> 16) {
x = 0xFFFF;
-#else
- if (x >> 16)
- {
-#if 0 // is this faster?
- x = (~x >> 31) & 0xFFFF;
-#else
- if (x < 0)
- x = 0;
- else
- x = 0xFFFF;
-#endif
}
-#endif
return x;
}
@@ -185,20 +173,12 @@ static SkBitmapProcState::FixedTileLowBitsProc choose_tile_lowbits_proc(unsigned
}
static inline U16CPU int_clamp(int x, int n) {
-#ifdef SK_CPU_HAS_CONDITIONAL_INSTR
- if (x >= n)
+ if (x >= n) {
x = n - 1;
- if (x < 0)
+ }
+ if (x < 0) {
x = 0;
-#else
- if ((unsigned)x >= (unsigned)n) {
- if (x < 0) {
- x = 0;
- } else {
- x = n - 1;
- }
}
-#endif
return x;
}
« no previous file with comments | « src/core/Sk64.cpp ('k') | src/core/SkMath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698