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

Unified Diff: Source/platform/graphics/gpu/WebGLImageConversion.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
« no previous file with comments | « Source/platform/graphics/gpu/WebGLImageConversion.h ('k') | Source/wtf/CPU.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/gpu/WebGLImageConversion.cpp
diff --git a/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index 06bb98fd19a70b5f908fcb214d7b89a3ba08e407..8aa7a61d3a94bad8a7c3e1046830051c4a447630 100644
--- a/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -7,7 +7,9 @@
#include "platform/CheckedInt.h"
#include "platform/graphics/ImageObserver.h"
-#include "platform/graphics/cpu/arm/WebGLImageConversionNEON.h"
+#if HAVE(ARM_NEON_INTRINSICS)
+#include "platform/graphics/cpu/arm/gpu/WebGLImageConversionNEON.h"
+#endif
#include "platform/image-decoders/ImageDecoder.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
@@ -303,9 +305,7 @@ template<> void unpack<WebGLImageConversion::DataFormatBGRA8, uint8_t, uint8_t>(
template<> void unpack<WebGLImageConversion::DataFormatRGBA5551, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
{
-#if HAVE(ARM_NEON_INTRINSICS)
- SIMD::unpackOneRowOfRGBA5551ToRGBA8(source, destination, pixelsPerRow);
-#endif
+ WTF_CPU_ARM_NEON_WRAP(SIMD::unpackOneRowOfRGBA5551ToRGBA8)(source, destination, pixelsPerRow);
for (unsigned i = 0; i < pixelsPerRow; ++i) {
uint16_t packedValue = source[0];
uint8_t r = packedValue >> 11;
@@ -322,9 +322,7 @@ template<> void unpack<WebGLImageConversion::DataFormatRGBA5551, uint16_t, uint8
template<> void unpack<WebGLImageConversion::DataFormatRGBA4444, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
{
-#if HAVE(ARM_NEON_INTRINSICS)
- SIMD::unpackOneRowOfRGBA4444ToRGBA8(source, destination, pixelsPerRow);
-#endif
+ WTF_CPU_ARM_NEON_WRAP(SIMD::unpackOneRowOfRGBA4444ToRGBA8)(source, destination, pixelsPerRow);
for (unsigned i = 0; i < pixelsPerRow; ++i) {
uint16_t packedValue = source[0];
uint8_t r = packedValue >> 12;
@@ -342,9 +340,7 @@ template<> void unpack<WebGLImageConversion::DataFormatRGBA4444, uint16_t, uint8
template<> void unpack<WebGLImageConversion::DataFormatRGB565, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
{
-#if HAVE(ARM_NEON_INTRINSICS)
- SIMD::unpackOneRowOfRGB565ToRGBA8(source, destination, pixelsPerRow);
-#endif
+ WTF_CPU_ARM_NEON_WRAP(SIMD::unpackOneRowOfRGB565ToRGBA8)(source, destination, pixelsPerRow);
for (unsigned i = 0; i < pixelsPerRow; ++i) {
uint16_t packedValue = source[0];
uint8_t r = packedValue >> 11;
@@ -702,9 +698,7 @@ template<> void pack<WebGLImageConversion::DataFormatRGBA8, WebGLImageConversion
template<> void pack<WebGLImageConversion::DataFormatRGBA4444, WebGLImageConversion::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
{
-#if HAVE(ARM_NEON_INTRINSICS)
- SIMD::packOneRowOfRGBA8ToUnsignedShort4444(source, destination, pixelsPerRow);
-#endif
+ WTF_CPU_ARM_NEON_WRAP(SIMD::packOneRowOfRGBA8ToUnsignedShort4444)(source, destination, pixelsPerRow);
for (unsigned i = 0; i < pixelsPerRow; ++i) {
*destination = (((source[0] & 0xF0) << 8)
| ((source[1] & 0xF0) << 4)
@@ -750,9 +744,7 @@ template<> void pack<WebGLImageConversion::DataFormatRGBA4444, WebGLImageConvers
template<> void pack<WebGLImageConversion::DataFormatRGBA5551, WebGLImageConversion::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
{
-#if HAVE(ARM_NEON_INTRINSICS)
- SIMD::packOneRowOfRGBA8ToUnsignedShort5551(source, destination, pixelsPerRow);
-#endif
+ WTF_CPU_ARM_NEON_WRAP(SIMD::packOneRowOfRGBA8ToUnsignedShort5551)(source, destination, pixelsPerRow);
for (unsigned i = 0; i < pixelsPerRow; ++i) {
*destination = (((source[0] & 0xF8) << 8)
| ((source[1] & 0xF8) << 3)
@@ -798,9 +790,7 @@ template<> void pack<WebGLImageConversion::DataFormatRGBA5551, WebGLImageConvers
template<> void pack<WebGLImageConversion::DataFormatRGB565, WebGLImageConversion::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
{
-#if HAVE(ARM_NEON_INTRINSICS)
- SIMD::packOneRowOfRGBA8ToUnsignedShort565(source, destination, pixelsPerRow);
-#endif
+ WTF_CPU_ARM_NEON_WRAP(SIMD::packOneRowOfRGBA8ToUnsignedShort565)(source, destination, pixelsPerRow);
for (unsigned i = 0; i < pixelsPerRow; ++i) {
*destination = (((source[0] & 0xF8) << 8)
| ((source[1] & 0xFC) << 3)
« no previous file with comments | « Source/platform/graphics/gpu/WebGLImageConversion.h ('k') | Source/wtf/CPU.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698