| /* |
| * Copyright (C) 2018 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.1 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.1 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| package android.hardware.configstore@1.2; |
| |
| import android.hardware.graphics.common@1.1::PixelFormat; |
| import android.hardware.graphics.common@1.2::Dataspace; |
| import @1.1::ISurfaceFlingerConfigs; |
| import @1.0::OptionalBool; |
| |
| /** |
| * New revision of ISurfaceFlingerConfigs |
| */ |
| interface ISurfaceFlingerConfigs extends @1.1::ISurfaceFlingerConfigs { |
| /** |
| * useColorManagement indicates whether SurfaceFlinger should manage color |
| * by switching to appropriate color mode automatically depending on the |
| * Dataspace of the surfaces on screen. |
| * This function must return true when hasWideColorDisplay or hasHDRDisplay |
| * return true. |
| */ |
| useColorManagement() generates (OptionalBool value); |
| |
| /** |
| * Returns the default data space and pixel format that SurfaceFlinger |
| * expects to receive and output as well as the wide color gamut data space |
| * and pixel format for wide color gamut surfaces. |
| * To determine the data space and pixel format, there are a few things |
| * we recommend to consider: |
| * |
| * 1. Hardware composer's capability to composite contents with the chosen |
| * data space and pixel format efficiently; |
| * 2. Hardware composer's ability to composite contents when sRGB contents |
| * and the chosen wide color gamut data space contents coexist; |
| * 3. For better blending, consider using pixel format where the alpha |
| * channel has as many bits as the RGB color channel. |
| * 4. Memory consumption and efficient buffer compression when considering |
| * more bits in pixel format. |
| * |
| * @return dataspace is the default data space that SurfaceFlinger expects. |
| * The data space must not be Dataspace::UNKNOWN, if unspecified, |
| * the default data space is Dataspace::V0_SRGB; |
| * @return pixelFormat is the default pixel format that SurfaceFlinger |
| * expects. If unspecified, the default pixel format is |
| * PixelFormat::RGBA_8888. |
| * @return wcgDataspace is the data space that SurfaceFlinger expects for |
| * wide color gamut surfaces. |
| * When hasWideColorDisplay returns true, this API must return a |
| * valid wide color gamut data space. |
| * The data space must not be UNKNOWN, if unspecified, the data space |
| * is V0_SRGB by default, which essentially indicates there's no wide |
| * color gamut, meaning hasWideColorDisplay returns false. |
| * @return wcgPixelFormat is the pixel format that SurfaceFlinger expects for |
| * wide color gamut surfaces. If unspecified, the pixel format is |
| * PixelFormat::RGBA_8888 by default. |
| */ |
| getCompositionPreference() |
| generates (Dataspace dataspace, PixelFormat pixelFormat, |
| Dataspace wcgDataspace, PixelFormat wcgPixelFormat); |
| }; |