summaryrefslogtreecommitdiffstats
path: root/minui/include
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-11-01 04:28:35 +0100
committerandroid-build-merger <android-build-merger@google.com>2018-11-01 04:28:35 +0100
commit6e0ce63c4b14dfc976110ba3ed4a2cd17365544a (patch)
treeb85763984bf5181303d40af60c21dc1dae80a812 /minui/include
parentMerge "recovery: Fix mounting /system with dynamic partitions." (diff)
parentMerge "minui: Add a protected GRSurface ctor." (diff)
downloadandroid_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.tar
android_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.tar.gz
android_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.tar.bz2
android_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.tar.lz
android_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.tar.xz
android_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.tar.zst
android_bootable_recovery-6e0ce63c4b14dfc976110ba3ed4a2cd17365544a.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 };
};