From 63b59dceadcce2c31b617e884941bf26b2730eb0 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 31 Oct 2018 15:23:04 -0700 Subject: minui: Add GRSurface::Clone(). Clone() allows duplicating the image that's stored in the GRSurface. Test: Run recovery_unit_test. Change-Id: Ia50d507c6200f2de5f17143775de805247a60e1f --- minui/include/minui/minui.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'minui/include') diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h index d6881e9a0..0b499e621 100644 --- a/minui/include/minui/minui.h +++ b/minui/include/minui/minui.h @@ -40,6 +40,9 @@ class GRSurface { static std::unique_ptr Create(int width, int height, int row_bytes, int pixel_bytes, size_t data_size); + // Clones the current GRSurface instance (i.e. an image). + std::unique_ptr Clone() const; + virtual uint8_t* data() { return data_; } @@ -59,6 +62,7 @@ class GRSurface { private: uint8_t* data_{ nullptr }; + size_t data_size_; DISALLOW_COPY_AND_ASSIGN(GRSurface); }; -- cgit v1.2.3