summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 414856794f..d51a8ea1c7 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -1906,6 +1906,18 @@ eng_gl_surface_read_pixels(void *engine EINA_UNUSED, void *surface,
1906 { 1906 {
1907 glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels); 1907 glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
1908 done = (glGetError() == GL_NO_ERROR); 1908 done = (glGetError() == GL_NO_ERROR);
1909#ifdef WORDS_BIGENDIAN
1910 if (done)
1911 {
1912 DATA32 *ptr = pixels;
1913 int k;
1914 for (k = w * h; k; --k)
1915 {
1916 const DATA32 v = *ptr;
1917 *ptr++ = eina_swap32(v);
1918 }
1919 }
1920#endif
1909 } 1921 }
1910 1922
1911 if (!done) 1923 if (!done)
@@ -1917,9 +1929,13 @@ eng_gl_surface_read_pixels(void *engine EINA_UNUSED, void *surface,
1917 for (k = w * h; k; --k) 1929 for (k = w * h; k; --k)
1918 { 1930 {
1919 const DATA32 v = *ptr; 1931 const DATA32 v = *ptr;
1932#ifdef WORDS_BIGENDIAN
1933 *ptr++ = (v << 24) | (v >> 8);
1934#else
1920 *ptr++ = (v & 0xFF00FF00) 1935 *ptr++ = (v & 0xFF00FF00)
1921 | ((v & 0x00FF0000) >> 16) 1936 | ((v & 0x00FF0000) >> 16)
1922 | ((v & 0x000000FF) << 16); 1937 | ((v & 0x000000FF) << 16);
1938#endif
1923 } 1939 }
1924 } 1940 }
1925 1941