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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp

Issue 2304183002: Add MSA (MIPS SIMD Arch) optimized WebGL image conversion functions (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/Source/platform/graphics/cpu/mips/WebGLImageConversionMSA.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index 15dca38be87fafb4af5eba171a85834b7f2a42f3..44d458c7fed86e9af15f4dd4d8470946c1fd0012 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -427,6 +427,9 @@ template<> void unpack<WebGLImageConversion::DataFormatBGRA8, uint8_t, uint8_t>(
#if CPU(X86) || CPU(X86_64)
SIMD::unpackOneRowOfBGRA8LittleToRGBA8(source32, destination32, pixelsPerRow);
#endif
+#if HAVE(MIPS_MSA_INTRINSICS)
+ SIMD::unpackOneRowOfBGRA8LittleToRGBA8MSA(source32, destination32, pixelsPerRow);
+#endif
for (unsigned i = 0; i < pixelsPerRow; ++i) {
uint32_t bgra = source32[i];
#if CPU(BIG_ENDIAN)
@@ -475,6 +478,9 @@ template<> void unpack<WebGLImageConversion::DataFormatRGBA4444, uint16_t, uint8
#if HAVE(ARM_NEON_INTRINSICS)
SIMD::unpackOneRowOfRGBA4444ToRGBA8(source, destination, pixelsPerRow);
#endif
+#if HAVE(MIPS_MSA_INTRINSICS)
+ SIMD::unpackOneRowOfRGBA4444ToRGBA8MSA(source, destination, pixelsPerRow);
+#endif
for (unsigned i = 0; i < pixelsPerRow; ++i) {
uint16_t packedValue = source[0];
uint8_t r = packedValue >> 12;
@@ -748,7 +754,10 @@ template<> void pack<WebGLImageConversion::DataFormatRGBA8, WebGLImageConversion
{
#if CPU(X86) || CPU(X86_64)
SIMD::packOneRowOfRGBA8LittleToRGBA8(source, destination, pixelsPerRow);
-#else
+#endif
+#if HAVE(MIPS_MSA_INTRINSICS)
+ SIMD::packOneRowOfRGBA8LittleToRGBA8MSA(source, destination, pixelsPerRow);
+#endif
for (unsigned i = 0; i < pixelsPerRow; ++i) {
float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
@@ -761,7 +770,6 @@ template<> void pack<WebGLImageConversion::DataFormatRGBA8, WebGLImageConversion
source += 4;
destination += 4;
}
-#endif
}
template<> void pack<WebGLImageConversion::DataFormatRGBA4444, WebGLImageConversion::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
@@ -817,6 +825,9 @@ template<> void pack<WebGLImageConversion::DataFormatRGBA5551, WebGLImageConvers
#if HAVE(ARM_NEON_INTRINSICS)
SIMD::packOneRowOfRGBA8ToUnsignedShort5551(source, destination, pixelsPerRow);
#endif
+#if HAVE(MIPS_MSA_INTRINSICS)
+ SIMD::packOneRowOfRGBA8ToUnsignedShort5551MSA(source, destination, pixelsPerRow);
+#endif
for (unsigned i = 0; i < pixelsPerRow; ++i) {
*destination = (((source[0] & 0xF8) << 8)
| ((source[1] & 0xF8) << 3)
@@ -865,6 +876,9 @@ template<> void pack<WebGLImageConversion::DataFormatRGB565, WebGLImageConversio
#if HAVE(ARM_NEON_INTRINSICS)
SIMD::packOneRowOfRGBA8ToUnsignedShort565(source, destination, pixelsPerRow);
#endif
+#if HAVE(MIPS_MSA_INTRINSICS)
+ SIMD::packOneRowOfRGBA8ToUnsignedShort565MSA(source, destination, pixelsPerRow);
+#endif
for (unsigned i = 0; i < pixelsPerRow; ++i) {
*destination = (((source[0] & 0xF8) << 8)
| ((source[1] & 0xFC) << 3)
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/cpu/mips/WebGLImageConversionMSA.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698