Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88615059 authored by Courtney Goeltzenleuchter's avatar Courtney Goeltzenleuchter Committed by Android (Google) Code Review
Browse files

Merge "Check board config for wide-color color spaces"

parents 55d17443 a0c93e10
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -112,9 +112,11 @@ cc_library_shared {
        "libnativewindow",
        "liblog",
        "libhidlbase",
        "libhidltransport",
        "android.hidl.base@1.0",
        "android.hidl.token@1.0-utils",
        "android.hardware.graphics.bufferqueue@1.0",
        "android.hardware.configstore@1.0",
    ],

    export_shared_lib_headers: [
@@ -123,6 +125,8 @@ cc_library_shared {
        "android.hidl.token@1.0-utils",
        "android.hardware.graphics.bufferqueue@1.0",
    ],

    header_libs: ["android.hardware.configstore-utils"],
}

subdirs = ["tests"]
+13 −1
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@
#include <gui/ISurfaceComposer.h>
#include <private/gui/ComposerService.h>

#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
#include <configstore/Utils.h>

namespace android {

Surface::Surface(
@@ -289,6 +292,9 @@ status_t Surface::getFrameTimestamps(uint64_t frameNumber,
    return NO_ERROR;
}

using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;

status_t Surface::getWideColorSupport(bool* supported) {
    ATRACE_CALL();

@@ -301,13 +307,19 @@ status_t Surface::getWideColorSupport(bool* supported) {
    if (err)
        return err;

    bool wideColorBoardConfig =
        getBool<ISurfaceFlingerConfigs,
                &ISurfaceFlingerConfigs::hasWideColorDisplay>(false);

    *supported = false;
    for (android_color_mode_t colorMode : colorModes) {
        switch (colorMode) {
            case HAL_COLOR_MODE_DISPLAY_P3:
            case HAL_COLOR_MODE_ADOBE_RGB:
            case HAL_COLOR_MODE_DCI_P3:
                if (wideColorBoardConfig) {
                    *supported = true;
                }
                break;
            default:
                break;