From 959afb522272e8ab9f52ea561a6ac7223de9dcef Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 13 Aug 2020 14:18:33 +0900 Subject: [PATCH] DSRenderEngineDaliImpl-test: Modified to refer to stride when creating tbm_surface. - this commit only affects this test. Change-Id: I23498cee31735598dddfc6e92fa3e3107bac1cda Signed-off-by: Joonbum Ko --- tests/DSRenderEngineDaliImpl-test.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/DSRenderEngineDaliImpl-test.cpp b/tests/DSRenderEngineDaliImpl-test.cpp index 7b4b654..6836fb5 100644 --- a/tests/DSRenderEngineDaliImpl-test.cpp +++ b/tests/DSRenderEngineDaliImpl-test.cpp @@ -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; } } -- 2.7.4