summaryrefslogtreecommitdiffstats
path: root/minui/graphics_drm.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-08-04 01:56:41 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-08-04 01:56:41 +0200
commitf0e0fff6ea279bb05115a297ee2e8894505d980c (patch)
tree28037d5a1099e2bdcc5c0b1bb91a02f4e1769d2f /minui/graphics_drm.cpp
parentMerge "ui: Read custom recovery UI values via system property." am: 2117b4bd07 am: 17bf8d0518 (diff)
parentMerge "minui: Use runtime properties instead of build time vars." am: ebc04d1e7a (diff)
downloadandroid_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.tar
android_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.tar.gz
android_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.tar.bz2
android_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.tar.lz
android_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.tar.xz
android_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.tar.zst
android_bootable_recovery-f0e0fff6ea279bb05115a297ee2e8894505d980c.zip
Diffstat (limited to 'minui/graphics_drm.cpp')
-rw-r--r--minui/graphics_drm.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/minui/graphics_drm.cpp b/minui/graphics_drm.cpp
index 57912d1e8..9336a1e63 100644
--- a/minui/graphics_drm.cpp
+++ b/minui/graphics_drm.cpp
@@ -116,15 +116,16 @@ GRSurfaceDrm* MinuiBackendDrm::DrmCreateSurface(int width, int height) {
*surface = {};
uint32_t format;
-#if defined(RECOVERY_ABGR)
- format = DRM_FORMAT_RGBA8888;
-#elif defined(RECOVERY_BGRA)
- format = DRM_FORMAT_ARGB8888;
-#elif defined(RECOVERY_RGBX)
- format = DRM_FORMAT_XBGR8888;
-#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;
+ }
drm_mode_create_dumb create_dumb = {};
create_dumb.height = height;