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
This commit is contained in:
Tao Bao
2018-11-26 16:28:07 -08:00
parent ea4ec3149b
commit dd78982d58
9 changed files with 66 additions and 43 deletions
+2 -2
View File
@@ -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;