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
+3 -3
View File
@@ -32,8 +32,8 @@
#include "minui/minui.h"
std::unique_ptr<GRSurfaceFbdev> GRSurfaceFbdev::Create(int width, int height, int row_bytes,
int pixel_bytes) {
std::unique_ptr<GRSurfaceFbdev> GRSurfaceFbdev::Create(size_t width, size_t height,
size_t row_bytes, size_t pixel_bytes) {
// Cannot use std::make_unique to access non-public ctor.
return std::unique_ptr<GRSurfaceFbdev>(new GRSurfaceFbdev(width, height, row_bytes, pixel_bytes));
}
@@ -130,7 +130,7 @@ GRSurface* MinuiBackendFbdev::Init() {
fb_fd = std::move(fd);
SetDisplayedFramebuffer(0);
printf("framebuffer: %d (%d x %d)\n", fb_fd.get(), gr_draw->width, gr_draw->height);
printf("framebuffer: %d (%zu x %zu)\n", fb_fd.get(), gr_draw->width, gr_draw->height);
Blank(true);
Blank(false);