ui: Add constness to Draw- functions.

These functions take the given GRSurface instances as inputs, which
shouldn't be altered.

Test: mmma -j bootable/recovery
Test: Run recovery_unit_test.
Test: `Run graphics test` on marlin.
Change-Id: I51bf408e85faae2b497d4f148ab1dec22dd16c93
This commit is contained in:
Tao Bao
2018-10-23 10:54:02 -07:00
parent 66a576b79c
commit 65815b6d3a
5 changed files with 21 additions and 19 deletions
+9 -9
View File
@@ -42,26 +42,26 @@ static const std::vector<std::string> ITEMS{ "item1", "item2", "item3", "item4",
class MockDrawFunctions : public DrawInterface {
void SetColor(UIElement /* element */) const override {}
void DrawHighlightBar(int /* x */, int /* y */, int /* width */,
int /* height */) const override {};
int /* height */) const override {}
int DrawHorizontalRule(int /* y */) const override {
return 0;
};
}
int DrawTextLine(int /* x */, int /* y */, const std::string& /* line */,
bool /* bold */) const override {
return 0;
};
void DrawSurface(GRSurface* /* surface */, int /* sx */, int /* sy */, int /* w */, int /* h */,
int /* dx */, int /* dy */) const override {};
void DrawFill(int /* x */, int /* y */, int /* w */, int /* h */) const override {};
void DrawTextIcon(int /* x */, int /* y */, GRSurface* /* surface */) const override {};
}
void DrawSurface(const GRSurface* /* surface */, int /* sx */, int /* sy */, int /* w */,
int /* h */, int /* dx */, int /* dy */) const override {}
void DrawFill(int /* x */, int /* y */, int /* w */, int /* h */) const override {}
void DrawTextIcon(int /* x */, int /* y */, const GRSurface* /* surface */) const override {}
int DrawTextLines(int /* x */, int /* y */,
const std::vector<std::string>& /* lines */) const override {
return 0;
};
}
int DrawWrappedTextLines(int /* x */, int /* y */,
const std::vector<std::string>& /* lines */) const override {
return 0;
};
}
};
class ScreenUITest : public testing::Test {