summaryrefslogtreecommitdiffstats
path: root/minui/resources.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-08-05 05:06:23 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-08-05 05:06:23 +0200
commit6b7037a5c8b81f43d68af1343024bde0d4f60fde (patch)
tree28037d5a1099e2bdcc5c0b1bb91a02f4e1769d2f /minui/resources.cpp
parentSnap for 4927259 from 67b66c019ac5760b5e6d9e1280f2d36cec509956 to qt-release (diff)
parentMerge "minui: Use runtime properties instead of build time vars." am: ebc04d1e7a am: ce0409a560 am: 8f545f4c8c (diff)
downloadandroid_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.gz
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.bz2
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.lz
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.xz
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.zst
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.zip
Diffstat (limited to 'minui/resources.cpp')
-rw-r--r--minui/resources.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/minui/resources.cpp b/minui/resources.cpp
index c018d9b8c..477fbe2a2 100644
--- a/minui/resources.cpp
+++ b/minui/resources.cpp
@@ -207,9 +207,10 @@ int res_create_display_surface(const char* name, GRSurface** pSurface) {
return -8;
}
-#if defined(RECOVERY_ABGR) || defined(RECOVERY_BGRA)
- png_set_bgr(png_ptr);
-#endif
+ PixelFormat pixel_format = gr_pixel_format();
+ if (pixel_format == PixelFormat::ABGR || pixel_format == PixelFormat::BGRA) {
+ png_set_bgr(png_ptr);
+ }
for (png_uint_32 y = 0; y < height; ++y) {
std::vector<unsigned char> p_row(width * 4);
@@ -278,9 +279,9 @@ int res_create_multi_display_surface(const char* name, int* frames, int* fps,
}
}
-#if defined(RECOVERY_ABGR) || defined(RECOVERY_BGRA)
- png_set_bgr(png_ptr);
-#endif
+ if (gr_pixel_format() == PixelFormat::ABGR || gr_pixel_format() == PixelFormat::BGRA) {
+ png_set_bgr(png_ptr);
+ }
for (png_uint_32 y = 0; y < height; ++y) {
std::vector<unsigned char> p_row(width * 4);
@@ -327,9 +328,10 @@ int res_create_alpha_surface(const char* name, GRSurface** pSurface) {
surface->row_bytes = width;
surface->pixel_bytes = 1;
-#if defined(RECOVERY_ABGR) || defined(RECOVERY_BGRA)
- png_set_bgr(png_ptr);
-#endif
+ PixelFormat pixel_format = gr_pixel_format();
+ if (pixel_format == PixelFormat::ABGR || pixel_format == PixelFormat::BGRA) {
+ png_set_bgr(png_ptr);
+ }
for (png_uint_32 y = 0; y < height; ++y) {
unsigned char* p_row = surface->data + y * surface->row_bytes;