From 44478dfb7df31edc1f6b18af1578655bfdc882b0 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 31 Jul 2018 22:01:03 -0700 Subject: minui: Clean up the use of `rotation`. This CL uses scoped enum for GRRotation. It also refactors the previous comparisions to improve readability -- it was hard to tell the meaning of `if (rotation % 2)` unless by checking the exact values. It also temporarily adds STRINGFY to expand the macro of DEFAULT_ROTATION. This will be removed once minui is changed from reading build time vars to runtime properties. Test: Build and boot into recovery image on marlin. Test: Set `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT` and check the display under recovery with `Run graphics test`. Change-Id: Ieb08b1cd13c284f8dcf906cb2a1430c6bae2835b --- minui/include/minui/minui.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'minui/include') diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h index ef4abe252..97660d476 100644 --- a/minui/include/minui/minui.h +++ b/minui/include/minui/minui.h @@ -41,11 +41,11 @@ struct GRFont { int char_height; }; -enum GRRotation { - ROTATION_NONE = 0, - ROTATION_RIGHT = 1, - ROTATION_DOWN = 2, - ROTATION_LEFT = 3, +enum class GRRotation : int { + NONE = 0, + RIGHT = 1, + DOWN = 2, + LEFT = 3, }; // Initializes the graphics backend and loads font file. Returns 0 on success, or -1 on error. Note -- cgit v1.2.3