Invert pixel buffer y order of GetPixels in X-NativeImageSource 99/244599/3
authorseungho <seungho@seungho.tn.corp.samsungelectronics.net>
Tue, 22 Sep 2020 08:13:13 +0000 (17:13 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 23 Sep 2020 13:21:13 +0000 (13:21 +0000)
 - In the current implementation, the results of GetPixels are different for each platform.

Change-Id: Ifa1cfd5d08a136c6bd2256af3a092c1f3463721d
Signed-off-by: seungho <seungho@seungho.tn.corp.samsungelectronics.net>
dali/internal/imaging/ubuntu-x11/native-image-source-impl-x.cpp

index 54ad246..d7dc6ed 100755 (executable)
@@ -187,7 +187,7 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
         pixbuf.resize(width*height*3);
         unsigned char* bufPtr = &pixbuf[0];
 
-        for(unsigned y = height-1; y < height; --y)
+        for(unsigned y = 0; y < height; ++y)
         {
           for(unsigned x = 0; x < width; ++x, bufPtr+=3)
           {
@@ -218,7 +218,7 @@ bool NativeImageSourceX::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
           const size_t copy_count = static_cast< size_t >( width ) * 4;
           pixelFormat = Pixel::BGRA8888;
 
-          for(unsigned y = height-1; y < height; --y, bufPtr += width)
+          for(unsigned y = 0; y < height; ++y, bufPtr += width)
           {
             const char * const in = pXImage->data + xDataLineSkip * y;