diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-05 18:27:57 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-05 18:27:57 +0000 |
commit | a8c09668f9e602f77422a344dfa4d13155c91fd3 (patch) | |
tree | a0948b0f4cc33f7860154663dd8974d26be43cef /src/core/SkBitmapProcState_matrixProcs.cpp | |
parent | fd47a121dc65b1bf8a63943d202d3b905858129b (diff) |
ARM Skia NEON patches - 18 - Preparation work for BitmapProcState
BitmapProcState: clean a little and get rid of some asm
replacing the apparently stupid dx+dx+dx leads to more instructions
being generated.
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
BitmapProcState: move code common to C and NEON to a separate header
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
BUG=
R=djsollen@google.com
Author: kevin.petit.arm@gmail.com
Review URL: https://chromiumcodereview.appspot.com/21931002
git-svn-id: http://skia.googlecode.com/svn/trunk@11109 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBitmapProcState_matrixProcs.cpp')
-rw-r--r-- | src/core/SkBitmapProcState_matrixProcs.cpp | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp index 70d367b870..57376d5699 100644 --- a/src/core/SkBitmapProcState_matrixProcs.cpp +++ b/src/core/SkBitmapProcState_matrixProcs.cpp @@ -9,13 +9,7 @@ #include "SkShader.h" #include "SkUtils.h" #include "SkUtilsArm.h" - -// Helper to ensure that when we shift down, we do it w/o sign-extension -// so the caller doesn't have to manually mask off the top 16 bits -// -static unsigned SK_USHIFT16(unsigned x) { - return x >> 16; -} +#include "SkBitmapProcState_utils.h" /* returns 0...(n-1) given any x (positive or negative). @@ -36,35 +30,6 @@ static inline int sk_int_mod(int x, int n) { return x; } -/* - * The decal_ functions require that - * 1. dx > 0 - * 2. [fx, fx+dx, fx+2dx, fx+3dx, ... fx+(count-1)dx] are all <= maxX - * - * In addition, we use SkFractionalInt to keep more fractional precision than - * just SkFixed, so we will abort the decal_ call if dx is very small, since - * the decal_ function just operates on SkFixed. If that were changed, we could - * skip the very_small test here. - */ -static inline bool can_truncate_to_fixed_for_decal(SkFractionalInt frX, - SkFractionalInt frDx, - int count, unsigned max) { - SkFixed dx = SkFractionalIntToFixed(frDx); - - // if decal_ kept SkFractionalInt precision, this would just be dx <= 0 - // I just made up the 1/256. Just don't want to perceive accumulated error - // if we truncate frDx and lose its low bits. - if (dx <= SK_Fixed1 / 256) { - return false; - } - - // We cast to unsigned so we don't have to check for negative values, which - // will now appear as very large positive values, and thus fail our test! - SkFixed fx = SkFractionalIntToFixed(frX); - return (unsigned)SkFixedFloorToInt(fx) <= max && - (unsigned)SkFixedFloorToInt(fx + dx * (count - 1)) < max; -} - void decal_nofilter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count); void decal_filter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count); |