DSRenderEngineDaliImpl-test: Modified to refer to stride when creating tbm_surface. 15/241815/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Thu, 13 Aug 2020 05:18:33 +0000 (14:18 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:11:37 +0000 (19:11 +0900)
 - this commit only affects this test.

Change-Id: I23498cee31735598dddfc6e92fa3e3107bac1cda
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
tests/DSRenderEngineDaliImpl-test.cpp

index 7b4b654..6836fb5 100644 (file)
@@ -77,15 +77,19 @@ public:
                tbmSurface = tbm_surface_create(w, h, TBM_FORMAT_ARGB8888);
                tbm_surface_map(tbmSurface, TBM_SURF_OPTION_WRITE | TBM_SURF_OPTION_READ, &tbmSurface_info);
 
+               uint32_t stride = tbmSurface_info.planes[0].stride;
                unsigned char *ptr = tbmSurface_info.planes[0].ptr;
+
                for (int j = 0; j < h; j++)
                {
-                       for (int i = 0; i < w; i++)
+                       for (int i = 0; i < stride/4; i++)
                        {
-                               ptr[0] = b;
-                               ptr[1] = g;
-                               ptr[2] = r;
-                               ptr[3] = a;
+                               if (i < w) {
+                                       ptr[0] = b;
+                                       ptr[1] = g;
+                                       ptr[2] = r;
+                                       ptr[3] = a;
+                               }
                                ptr += 4;
                        }
                }