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

Unified Diff: Source/platform/graphics/filters/FilterEffect.cpp

Issue 604373003: [WIP] Supporting arm_neon_optional flag for blink platform. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
Index: Source/platform/graphics/filters/FilterEffect.cpp
diff --git a/Source/platform/graphics/filters/FilterEffect.cpp b/Source/platform/graphics/filters/FilterEffect.cpp
index 9ec5524bf1e511e8f3442aad82daae643f3a0bf0..6b81913c94583df6b12c024e6f621fab225e404f 100644
--- a/Source/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/platform/graphics/filters/FilterEffect.cpp
@@ -25,14 +25,13 @@
#include "platform/graphics/filters/FilterEffect.h"
+#if HAVE(ARM_NEON_INTRINSICS)
+#include "platform/graphics/cpu/arm/filters/FilterEffectNEON.h"
+#endif
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/UnacceleratedImageBufferSurface.h"
#include "platform/graphics/filters/Filter.h"
-#if HAVE(ARM_NEON_INTRINSICS)
-#include <arm_neon.h>
-#endif
-
namespace blink {
static const float kMaxFilterArea = 4096 * 4096;
@@ -220,22 +219,8 @@ void FilterEffect::forceValidPreMultipliedPixels()
ASSERT(!(pixelArrayLength % 4));
#if HAVE(ARM_NEON_INTRINSICS)
- if (pixelArrayLength >= 64) {
- unsigned char* lastPixel = pixelData + (pixelArrayLength & ~0x3f);
- do {
- // Increments pixelData by 64.
- uint8x16x4_t sixteenPixels = vld4q_u8(pixelData);
- sixteenPixels.val[0] = vminq_u8(sixteenPixels.val[0], sixteenPixels.val[3]);
- sixteenPixels.val[1] = vminq_u8(sixteenPixels.val[1], sixteenPixels.val[3]);
- sixteenPixels.val[2] = vminq_u8(sixteenPixels.val[2], sixteenPixels.val[3]);
- vst4q_u8(pixelData, sixteenPixels);
- pixelData += 64;
- } while (pixelData < lastPixel);
-
- pixelArrayLength &= 0x3f;
- if (!pixelArrayLength)
- return;
- }
+ if (hasCPUNEON())
+ pixelArrayLength = validPreMultipliedPixels64NEON(imageArray->length(), pixelData);
#endif
int numPixels = pixelArrayLength / 4;
« no previous file with comments | « Source/platform/graphics/filters/FilterEffect.h ('k') | Source/platform/graphics/gpu/WebGLImageConversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698