Skip to content

Commit

Permalink
Revert "NEON optimized blitter S32_Opaque_D32_filter_DX"
Browse files Browse the repository at this point in the history
This reverts commit 614d0f4.

Change-Id: I7f90acf4f9c0c28cacc1e1a25973c4c18b88fc80
  • Loading branch information
Prasanth Kamuju committed Aug 31, 2016
1 parent 662baab commit 7633cdb
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 653 deletions.
3 changes: 1 addition & 2 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,7 @@ LOCAL_SRC_FILES_arm += \
src/opts/SkBitmapProcState_matrixProcs_neon.cpp \
src/opts/SkBlitMask_opts_arm_neon.cpp \
src/opts/SkBlitRow_opts_arm_neon.cpp \
src/opts/SkOpts_neon.cpp \
src/opts/ext/S32_Opaque_D32_filter_DX_shaderproc_neon.cpp
src/opts/SkOpts_neon.cpp

LOCAL_CFLAGS_arm += \
-DSK_ARM_HAS_NEON
Expand Down
1 change: 0 additions & 1 deletion gyp/opts.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
'<(skia_src_path)/opts/SkBlitMask_opts_arm_neon.cpp',
'<(skia_src_path)/opts/SkBlitRow_opts_arm_neon.cpp',
'<(skia_src_path)/opts/SkOpts_neon.cpp',
'<(skia_src_path)/opts/ext/S32_Opaque_D32_filter_DX_shaderproc_neon.cpp',
],
'arm64_sources': [
'<(skia_src_path)/opts/SkBitmapProcState_arm_neon.cpp',
Expand Down
29 changes: 0 additions & 29 deletions src/core/SkBitmapProcShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,19 @@
#include "SkPixelRef.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkUtilsArm.h"

#if SK_SUPPORT_GPU
#include "SkGrPriv.h"
#include "effects/GrBicubicEffect.h"
#include "effects/GrSimpleTextureEffect.h"
#endif

#include "SkBitmapProcState_utils.h"
#if !SK_ARM_NEON_IS_NONE
#if !defined(__LP64__)
extern void Clamp_S32_Opaque_D32_filter_DX_shaderproc_neon(const void*, int, int, uint32_t*, int);
#endif
#endif

size_t SkBitmapProcShader::ContextSize() {
// The SkBitmapProcState is stored outside of the context object, with the context holding
// a pointer to it.
return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState);
}

bool checkDecal(const SkBitmapProcState& s, int x, int y, int count) {
const unsigned maxX = s.fPixmap.width() - 1;
const SkFixed one = s.fFilterOneX;
const SkFractionalInt dx = s.fInvSxFractionalInt;
SkFractionalInt fx;

{
SkPoint pt;
s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, &pt);
// now initialize fx
fx = SkScalarToFractionalInt(pt.fX) - (SkFixedToFractionalInt(one) >> 1);
}

// test if we don't need to apply the tile proc
if (can_truncate_to_fixed_for_decal(fx, dx, count, maxX)) {
return true;
}
return true;
}

SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix)
: INHERITED(localMatrix) {
Expand Down
8 changes: 0 additions & 8 deletions src/core/SkBitmapProcState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ extern void Repeat_S16_D16_filter_DX_shaderproc_neon(const void *, int, int, ui
extern void SI8_opaque_D32_filter_DX_neon(const SkBitmapProcState&, const uint32_t*, int, SkPMColor*);
extern void SI8_opaque_D32_filter_DX_shaderproc_neon(const void *, int, int, uint32_t*, int);
extern void Clamp_SI8_opaque_D32_filter_DX_shaderproc_neon(const void*, int, int, uint32_t*, int);
#if !defined(__LP64__)
extern void S32_opaque_D32_filter_DX_neon(const SkBitmapProcState&, const uint32_t*, int, SkPMColor*);
extern void Clamp_S32_Opaque_D32_filter_DX_shaderproc_neon(const void*, int, int, uint32_t*, int);
#endif //#if !defined(__LP64__)
#endif

extern void Clamp_S32_opaque_D32_nofilter_DX_shaderproc(const void*, int, int, uint32_t*, int);
Expand Down Expand Up @@ -362,10 +358,6 @@ bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp,
// our special-case shaderprocs
if (SK_ARM_NEON_WRAP(SI8_opaque_D32_filter_DX) == fSampleProc32 && clampClamp) {
fShaderProc32 = SK_ARM_NEON_WRAP(Clamp_SI8_opaque_D32_filter_DX_shaderproc);
#if !defined(__LP64__)
} else if (SK_ARM_NEON_WRAP(S32_opaque_D32_filter_DX) == fSampleProc32 && clampClamp) {
fShaderProc32 = SK_ARM_NEON_WRAP(Clamp_S32_Opaque_D32_filter_DX_shaderproc);
#endif
} else if (S32_opaque_D32_nofilter_DX == fSampleProc32 && clampClamp) {
fShaderProc32 = Clamp_S32_opaque_D32_nofilter_DX_shaderproc;
}
Expand Down
18 changes: 0 additions & 18 deletions src/core/SkBitmapProcState_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,22 +248,4 @@ static inline U8CPU Filter_8(unsigned x, unsigned y,
#define POSTAMBLE(state)
#include "SkBitmapProcState_shaderproc.h"

#if !defined(__LP64__)
#define TILEX_PROCF(fx, max) SkClampMax((fx) >> 16, max)
#define TILEY_PROCF(fy, max) SkClampMax((fy) >> 16, max)
#define TILEX_LOW_BITS(fx, max) (((fx) >> 12) & 0xF)
#define TILEY_LOW_BITS(fy, max) (((fy) >> 12) & 0xF)

#undef FILTER_PROC
#define FILTER_PROC(x, y, a, b, c, d, dst) NAME_WRAP(Filter_32_opaque)(x, y, a, b, c, d, dst)
#define MAKENAME(suffix) NAME_WRAP(Clamp_S32_Opaque_D32 ## suffix)
#define SRCTYPE uint32_t
#define DSTTYPE uint32_t
#define CHECKSTATE(state) SkASSERT(kN32_SkColorType == state.fPixmap->colorType())
#define SRC_TO_FILTER(src) src
#define S32_OPAQUE_D32_FILTER_DX_NEON (!SK_ARM_NEON_IS_NONE)
#include "SkBitmapProcState_shaderproc.h"
#undef S32_OPAQUE_D32_FILTER_DX_NEON
#endif //#if !defined(__LP64__)

#undef NAME_WRAP
113 changes: 0 additions & 113 deletions src/core/SkBitmapProcState_shaderproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

#include "SkMathPriv.h"

#if S32_OPAQUE_D32_FILTER_DX_NEON
void S32_Opaque_D32_filter_DX_shaderproc_neon(const unsigned int* image0, const unsigned int* image1,
SkFixed fx, unsigned int maxX, unsigned int subY,
unsigned int* colors,
SkFixed dx, int count);
#endif

#define SCALE_FILTER_NAME MAKENAME(_filter_DX_shaderproc)

// Can't be static in the general case because some of these implementations
Expand Down Expand Up @@ -58,110 +51,6 @@ void SCALE_FILTER_NAME(const void* sIn, int x, int y, SkPMColor* SK_RESTRICT col
PREAMBLE(s);
#endif

#if S32_OPAQUE_D32_FILTER_DX_NEON
int post_count;
SkFixed post_fx;
DSTTYPE* SK_RESTRICT post_colors;
int num;
post_count = count;
post_fx = fx;
post_colors = colors;


if (dx>=0)
{
int end = ((int)maxX-1)<<16;
num = dx?((end-fx)/dx):0;
if (num < 0) num = 0;

if (num<count)
{
count = num;
post_count = post_count - count;
post_fx = fx + count*dx;
post_colors = post_colors + count;
}
else
post_count = 0;

while (fx<0 && count) {
unsigned subX = TILEX_LOW_BITS(fx, maxX);
unsigned x0 = TILEX_PROCF(fx, maxX);
unsigned x1 = TILEX_PROCF((fx + oneX), maxX);

FILTER_PROC(subX, subY,
SRC_TO_FILTER(row0[x0]),
SRC_TO_FILTER(row0[x1]),
SRC_TO_FILTER(row1[x0]),
SRC_TO_FILTER(row1[x1]),
colors);
colors += 1;

fx += dx;
count--;
}
}
else
{
int end = 0;
int maxXFix = ((int)maxX-1)<<16;
num = (end-fx)/dx;
if (num < 0) num = 0;


if (num<count)
{
count = num;
post_count = post_count - count;
post_fx = fx + count*dx;
post_colors = post_colors + count;
}
else
post_count = 0;

while (fx>=maxXFix && count) {
unsigned subX = TILEX_LOW_BITS(fx, maxX);
unsigned x0 = TILEX_PROCF(fx, maxX);
unsigned x1 = TILEX_PROCF((fx + oneX), maxX);

FILTER_PROC(subX, subY,
SRC_TO_FILTER(row0[x0]),
SRC_TO_FILTER(row0[x1]),
SRC_TO_FILTER(row1[x0]),
SRC_TO_FILTER(row1[x1]),
colors);
colors += 1;

fx += dx;
count--;
}

}

S32_Opaque_D32_filter_DX_shaderproc_neon(row0, row1, fx, maxX, subY, colors, dx, count);

fx = post_fx;
colors = post_colors;
while (post_count) {
unsigned subX = TILEX_LOW_BITS(fx, maxX);
unsigned x0 = TILEX_PROCF(fx, maxX);
unsigned x1 = TILEX_PROCF((fx + oneX), maxX);

FILTER_PROC(subX, subY,
SRC_TO_FILTER(row0[x0]),
SRC_TO_FILTER(row0[x1]),
SRC_TO_FILTER(row1[x0]),
SRC_TO_FILTER(row1[x1]),
colors);
colors += 1;

fx += dx;
post_count--;
}


#else //S32_OPAQUE_D32_FILTER_DX_NEON

do {
unsigned subX = TILEX_LOW_BITS(fx, maxX);
unsigned x0 = TILEX_PROCF(fx, maxX);
Expand All @@ -178,8 +67,6 @@ void SCALE_FILTER_NAME(const void* sIn, int x, int y, SkPMColor* SK_RESTRICT col
fx += dx;
} while (--count != 0);

#endif //S32_OPAQUE_D32_FILTER_DX_NEON

#ifdef POSTAMBLE
POSTAMBLE(s);
#endif
Expand Down
Loading

0 comments on commit 7633cdb

Please sign in to comment.