ARM Skia NEON patches - 01 - Simple fixes
This series contains a few fairly non-controversial fixes.
Misc: remove dead references to neon 4444 functions
Misc: avoid the double _neon_neon suffix in the clamp matrix functions.
MAKENAME already adds the _neon suffix
Misc: a few stupid / obvious fixes
BUG=
R=djsollen@google.com
Author: kevin.petit.arm@gmail.com
Review URL: https://chromiumcodereview.appspot.com/18666004
git-svn-id: http://skia.googlecode.com/svn/trunk@10072 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkColorPriv.h b/include/core/SkColorPriv.h
index fe59b1b..fe4377f 100644
--- a/include/core/SkColorPriv.h
+++ b/include/core/SkColorPriv.h
@@ -318,9 +318,9 @@
static inline
SkPMColor SkPremultiplyARGBInline(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
SkA32Assert(a);
- SkA32Assert(r);
- SkA32Assert(g);
- SkA32Assert(b);
+ SkR32Assert(r);
+ SkG32Assert(g);
+ SkB32Assert(b);
if (a != 255) {
r = SkMulDiv255Round(r, a);
@@ -334,7 +334,6 @@
static inline uint32_t SkAlphaMulQ(uint32_t c, unsigned scale) {
uint32_t mask = gMask_00FF00FF;
-// uint32_t mask = 0xFF00FF;
uint32_t rb = ((c & mask) * scale) >> 8;
uint32_t ag = ((c >> 8) & mask) * scale;
diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h
index 0f8f758..ba2479a 100644
--- a/include/core/SkFixed.h
+++ b/include/core/SkFixed.h
@@ -179,7 +179,7 @@
}
inline SkFract SkFractMul_longlong(SkFract a, SkFract b)
{
- return (SkFixed)((SkLONGLONG)a * b >> 30);
+ return (SkFract)((SkLONGLONG)a * b >> 30);
}
inline SkFixed SkFixedSquare_longlong(SkFixed value)
{
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index 615a6a3..cb57232 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -826,7 +826,7 @@
// shaders take care of global alpha, so we never set it in SkBlitRow
if (!(shaderFlags & SkShader::kOpaqueAlpha_Flag)) {
flags |= SkBlitRow::kSrcPixelAlpha_Flag;
- }
+ }
// don't dither if the shader is really 16bit
if (paint.isDither() && !(shaderFlags & SkShader::kIntrinsicly16_Flag)) {
flags |= SkBlitRow::kDither_Flag;
diff --git a/src/opts/SkBitmapProcState_matrix_clamp_neon.h b/src/opts/SkBitmapProcState_matrix_clamp_neon.h
index 23da547..a615e26 100644
--- a/src/opts/SkBitmapProcState_matrix_clamp_neon.h
+++ b/src/opts/SkBitmapProcState_matrix_clamp_neon.h
@@ -37,12 +37,12 @@
/* SkClampMax(val,max) -- bound to 0..max */
-#define SCALE_NOFILTER_NAME MAKENAME(_nofilter_scale_neon)
-#define SCALE_FILTER_NAME MAKENAME(_filter_scale_neon)
-#define AFFINE_NOFILTER_NAME MAKENAME(_nofilter_affine_neon)
-#define AFFINE_FILTER_NAME MAKENAME(_filter_affine_neon)
-#define PERSP_NOFILTER_NAME MAKENAME(_nofilter_persp_neon)
-#define PERSP_FILTER_NAME MAKENAME(_filter_persp_neon)
+#define SCALE_NOFILTER_NAME MAKENAME(_nofilter_scale)
+#define SCALE_FILTER_NAME MAKENAME(_filter_scale)
+#define AFFINE_NOFILTER_NAME MAKENAME(_nofilter_affine)
+#define AFFINE_FILTER_NAME MAKENAME(_filter_affine)
+#define PERSP_NOFILTER_NAME MAKENAME(_nofilter_persp)
+#define PERSP_FILTER_NAME MAKENAME(_filter_persp)
#define PACK_FILTER_X_NAME MAKENAME(_pack_filter_x)
#define PACK_FILTER_Y_NAME MAKENAME(_pack_filter_y)
diff --git a/src/opts/SkBlitRow_opts_arm_neon.cpp b/src/opts/SkBlitRow_opts_arm_neon.cpp
index 1e7f6f3..7868108 100644
--- a/src/opts/SkBlitRow_opts_arm_neon.cpp
+++ b/src/opts/SkBlitRow_opts_arm_neon.cpp
@@ -1255,20 +1255,6 @@
NULL, // S32A_D565_Blend_Dither
};
-const SkBlitRow::Proc sk_blitrow_platform_4444_procs_arm_neon[] = {
- // no dither
- NULL, // S32_D4444_Opaque,
- NULL, // S32_D4444_Blend,
- NULL, // S32A_D4444_Opaque,
- NULL, // S32A_D4444_Blend,
-
- // dither
- NULL, // S32_D4444_Opaque_Dither,
- NULL, // S32_D4444_Blend_Dither,
- NULL, // S32A_D4444_Opaque_Dither,
- NULL, // S32A_D4444_Blend_Dither
-};
-
const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm_neon[] = {
NULL, // S32_Opaque,
S32_Blend_BlitRow32_neon, // S32_Blend,
diff --git a/tests/BlitRowTest.cpp b/tests/BlitRowTest.cpp
index c4a4134..2b7d94a 100644
--- a/tests/BlitRowTest.cpp
+++ b/tests/BlitRowTest.cpp
@@ -166,7 +166,6 @@
struct Mesh {
SkPoint fPts[4];
- uint16_t fIndices[6];
Mesh(const SkBitmap& bm, SkPaint* paint) {
const SkScalar w = SkIntToScalar(bm.width());
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 1917004..0538a12 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -102,13 +102,13 @@
for (int y = 0; y < bm.height(); ++y) {
for (int x = 0; x < bm.width(); ++x) {
if (shouldBeDrawn) {
- if (0 == *bm.getAddr32(x, y)) {
+ if (SK_ColorTRANSPARENT == *bm.getAddr32(x, y)) {
REPORTER_ASSERT(reporter, false);
return;
}
} else {
// should not be drawn
- if (*bm.getAddr32(x, y)) {
+ if (SK_ColorTRANSPARENT != *bm.getAddr32(x, y)) {
REPORTER_ASSERT(reporter, false);
return;
}