Peiyong Lin | 2b3f826 | 2018-07-20 16:03:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.1 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.1 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package android.hardware.configstore@1.2; |
| 17 | |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame^] | 18 | import android.hardware.graphics.common@1.1::Dataspace; |
| 19 | import android.hardware.graphics.common@1.1::PixelFormat; |
Peiyong Lin | 2b3f826 | 2018-07-20 16:03:46 -0700 | [diff] [blame] | 20 | import @1.1::ISurfaceFlingerConfigs; |
| 21 | import @1.0::OptionalBool; |
| 22 | |
| 23 | /** |
| 24 | * New revision of ISurfaceFlingerConfigs |
| 25 | */ |
| 26 | interface ISurfaceFlingerConfigs extends @1.1::ISurfaceFlingerConfigs { |
| 27 | /** |
| 28 | * useColorManagement indicates whether SurfaceFlinger should manage color |
| 29 | * by switching to appropriate color mode automatically depending on the |
| 30 | * Dataspace of the surfaces on screen. |
| 31 | * This function must return true when hasWideColorDisplay or hasHDRDisplay |
| 32 | * return true. |
| 33 | */ |
| 34 | useColorManagement() generates (OptionalBool value); |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame^] | 35 | |
| 36 | /** |
| 37 | * Returns the default data space and default pixel format that |
| 38 | * SurfaceFlinger expects to receive and output. |
| 39 | * To determine the default data space and default pixel format, |
| 40 | * there are a few things we recommend to consider: |
| 41 | * |
| 42 | * 1. Hardware composer's capability to composite contents with the |
| 43 | * data space and pixel format efficiently; |
| 44 | * 2. Hardware composer's ability to composite contents when sRGB contents |
| 45 | * and the chosen data space contents coexist; |
| 46 | * 3. For better blending, consider using pixel format where the alpha |
| 47 | * channel has as many bits as the RGB color channel. |
| 48 | * |
| 49 | * @return dataSpace is the default data space that SurfaceFlinger expects. |
| 50 | * The data space must not be Dataspace::UNKNOWN, if unspecified, |
| 51 | * the default data space is Dataspace::V0_SRGB; |
| 52 | * @return pixelFormat is the default pixel format that SurfaceFlinger |
| 53 | * expects. If unspecified, the default pixel format is |
| 54 | * PixelFormat::RGBA_8888. |
| 55 | */ |
| 56 | getCompositionPreference() |
| 57 | generates (Dataspace dataSpace, PixelFormat pixelFormat); |
Peiyong Lin | 2b3f826 | 2018-07-20 16:03:46 -0700 | [diff] [blame] | 58 | }; |