summaryrefslogtreecommitdiffstats
path: root/minui/graphics_adf.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-08-01 06:32:50 +0200
committerTao Bao <tbao@google.com>2018-08-02 00:36:41 +0200
commited876a7175c54a68735e8bcacd1a22cbc84034ed (patch)
tree62857f4b3ef659dcbf137c6c917e23ee029e3dd6 /minui/graphics_adf.cpp
parentMerge "minui: Clean up the use of `rotation`." (diff)
downloadandroid_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.tar
android_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.tar.gz
android_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.tar.bz2
android_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.tar.lz
android_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.tar.xz
android_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.tar.zst
android_bootable_recovery-ed876a7175c54a68735e8bcacd1a22cbc84034ed.zip
Diffstat (limited to 'minui/graphics_adf.cpp')
-rw-r--r--minui/graphics_adf.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp
index a59df00c6..7439df9ac 100644
--- a/minui/graphics_adf.cpp
+++ b/minui/graphics_adf.cpp
@@ -104,15 +104,16 @@ int MinuiBackendAdf::DeviceInit(adf_device* dev) {
}
GRSurface* MinuiBackendAdf::Init() {
-#if defined(RECOVERY_ABGR)
- format = DRM_FORMAT_ABGR8888;
-#elif defined(RECOVERY_BGRA)
- format = DRM_FORMAT_BGRA8888;
-#elif defined(RECOVERY_RGBX)
- format = DRM_FORMAT_RGBX8888;
-#else
- format = DRM_FORMAT_RGB565;
-#endif
+ PixelFormat pixel_format = gr_pixel_format();
+ if (pixel_format == PixelFormat::ABGR) {
+ format = DRM_FORMAT_ABGR8888;
+ } else if (pixel_format == PixelFormat::BGRA) {
+ format = DRM_FORMAT_BGRA8888;
+ } else if (pixel_format == PixelFormat::RGBX) {
+ format = DRM_FORMAT_RGBX8888;
+ } else {
+ format = DRM_FORMAT_RGB565;
+ }
adf_id_t* dev_ids = nullptr;
ssize_t n_dev_ids = adf_devices(&dev_ids);