From dd78982d580aa61c39bfd13940140e5830f489b2 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Mon, 26 Nov 2018 16:28:07 -0800 Subject: minui: GRSurface::Create() computes data_size on its own. GRSurface::Create() doesn't need to rely on caller specifying the buffer size, as it can compute that info based on the given args. This CL also uses `size_t` for all the parameters in GRSurface::Create(). Test: Run recovery_unit_test on marlin. Test: Build and boot into blueline recovery. `Run graphics test`. Test: Build and boot into blueline charger mode. Change-Id: Idec9381079196abf13553a475006fefcfca10950 --- screen_ui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'screen_ui.cpp') diff --git a/screen_ui.cpp b/screen_ui.cpp index ed71888d1..765d2fe60 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -282,14 +282,14 @@ bool GraphicMenu::ValidateGraphicSurface(size_t max_width, size_t max_height, in } if (surface->pixel_bytes != 1 || surface->width != surface->row_bytes) { - fprintf(stderr, "Invalid graphic surface, pixel bytes: %d, width: %d row_bytes: %d", + fprintf(stderr, "Invalid graphic surface, pixel bytes: %zu, width: %zu row_bytes: %zu", surface->pixel_bytes, surface->width, surface->row_bytes); return false; } if (surface->width > max_width || surface->height > max_height - y) { fprintf(stderr, - "Graphic surface doesn't fit into the screen. width: %d, height: %d, max_width: %zu," + "Graphic surface doesn't fit into the screen. width: %zu, height: %zu, max_width: %zu," " max_height: %zu, vertical offset: %d\n", surface->width, surface->height, max_width, max_height, y); return false; -- cgit v1.2.3