summaryrefslogtreecommitdiffstats
path: root/minui/include
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-10-31 07:34:50 +0100
committerTao Bao <tbao@google.com>2018-10-31 19:19:28 +0100
commit44820ac1e31ffa029ab5baa71238a11b6db3e6cc (patch)
treee1060ff8e93e1e868558b2d0400c400191571204 /minui/include
parentMerge "Add description for the new translation" (diff)
downloadandroid_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.tar
android_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.tar.gz
android_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.tar.bz2
android_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.tar.lz
android_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.tar.xz
android_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.tar.zst
android_bootable_recovery-44820ac1e31ffa029ab5baa71238a11b6db3e6cc.zip
Diffstat (limited to 'minui/include')
-rw-r--r--minui/include/minui/minui.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h
index e9bd1c4f1..66d992b93 100644
--- a/minui/include/minui/minui.h
+++ b/minui/include/minui/minui.h
@@ -33,10 +33,11 @@ class GRSurface {
GRSurface() = default;
virtual ~GRSurface();
- // Creates and returns a GRSurface instance for the given data_size. The starting address of the
- // surface data is aligned to SURFACE_DATA_ALIGNMENT. Returns the created GRSurface instance (in
- // std::unique_ptr), or nullptr on error.
- static std::unique_ptr<GRSurface> Create(size_t data_size);
+ // Creates and returns a GRSurface instance that's sufficient for storing an image of the given
+ // size. The starting address of the surface data is aligned to SURFACE_DATA_ALIGNMENT. Returns
+ // the created GRSurface instance (in std::unique_ptr), or nullptr on error.
+ static std::unique_ptr<GRSurface> Create(int width, int height, int row_bytes, int pixel_bytes,
+ size_t data_size);
virtual uint8_t* data() {
return data_;
@@ -51,6 +52,10 @@ class GRSurface {
int row_bytes;
int pixel_bytes;
+ protected:
+ GRSurface(int width, int height, int row_bytes, int pixel_bytes)
+ : width(width), height(height), row_bytes(row_bytes), pixel_bytes(pixel_bytes) {}
+
private:
uint8_t* data_{ nullptr };
};