Fix skia bug 2845
authorkui.zheng <kui.zheng@arm.com>
Tue, 17 Feb 2015 16:01:52 +0000 (08:01 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 17 Feb 2015 16:01:52 +0000 (08:01 -0800)
Shouldn't call Fast Blur path(DoubleRowBoxBlur_NEON)
when kernelsize is 1. Or, uint16x8_t resultPixels will be overflow.

BUG=skia:2845
R=senorblanco@chromium.org

Review URL: https://codereview.chromium.org/587543003

src/opts/SkBlitRow_opts_arm_neon.cpp
src/opts/SkBlurImage_opts_arm.cpp
src/opts/SkBlurImage_opts_neon.cpp

index 8981fd7fee6967ad23f2d3713099890f4dd30304..4465ff6ef5190c9cd6bb2a4739cec198fd868bc5 100644 (file)
@@ -1778,8 +1778,7 @@ const SkBlitRow::Proc16 sk_blitrow_platform_565_procs_arm_neon[] = {
 #if 0
     S32A_D565_Blend_neon,
 #else
-    NULL,   // https://code.google.com/p/skia/issues/detail?id=2845
-            // https://code.google.com/p/skia/issues/detail?id=2797
+    NULL,   // https://code.google.com/p/skia/issues/detail?id=2797
 #endif
 
     // dither
index fb6103482ccfdcd2e46579e3c7c4020539b65098..10d595afa5911cc492baa4258508025c2085bfd2 100644 (file)
@@ -12,9 +12,6 @@ bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX,
                                SkBoxBlurProc* boxBlurY,
                                SkBoxBlurProc* boxBlurXY,
                                SkBoxBlurProc* boxBlurYX) {
-    // Temporary workaround for http://skbug.com/2845
-    return false;
-
 #if SK_ARM_NEON_IS_NONE
     return false;
 #else
index 08187f3e55e2f4883f8249f7e36b6c165a65a3d5..760980e36fd0da545f29ceee590153ef6079d871 100644 (file)
@@ -123,7 +123,7 @@ void SkBoxBlur_NEON(const SkPMColor* src, int srcStride, SkPMColor* dst, int ker
     const uint32x4_t scale = vdupq_n_u32((1 << 24) / kernelSize);
     const uint32x4_t half = vdupq_n_u32(1 << 23);
 
-    if (kernelSize < 128)
+    if (1 < kernelSize && kernelSize < 128)
     {
         SkDoubleRowBoxBlur_NEON<srcDirection, dstDirection>(&src, srcStride, &dst, kernelSize,
             leftOffset, rightOffset, width, &height);