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
diff --git a/tests/unit/screen_ui_test.cpp b/tests/unit/screen_ui_test.cpp
index 09c4997..61a0925 100644
--- a/tests/unit/screen_ui_test.cpp
+++ b/tests/unit/screen_ui_test.cpp
@@ -231,7 +231,7 @@
}
TEST_F(ScreenUITest, GraphicMenuSelection) {
- auto image = GRSurface::Create(50, 50, 50, 1, 50 * 50);
+ auto image = GRSurface::Create(50, 50, 50, 1);
auto header = image->Clone();
std::vector<const GRSurface*> items = {
image.get(),
@@ -258,7 +258,7 @@
}
TEST_F(ScreenUITest, GraphicMenuValidate) {
- auto image = GRSurface::Create(50, 50, 50, 1, 50 * 50);
+ auto image = GRSurface::Create(50, 50, 50, 1);
auto header = image->Clone();
std::vector<const GRSurface*> items = {
image.get(),
@@ -269,7 +269,7 @@
ASSERT_TRUE(GraphicMenu::Validate(200, 200, header.get(), items));
// Menu exceeds the horizontal boundary.
- auto wide_surface = GRSurface::Create(300, 50, 300, 1, 300 * 50);
+ auto wide_surface = GRSurface::Create(300, 50, 300, 1);
ASSERT_FALSE(GraphicMenu::Validate(299, 200, wide_surface.get(), items));
// Menu exceeds the vertical boundary.