| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (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.0 |
| 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 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include <math/mat4.h> |
| 20 | #include <ui/GraphicTypes.h> |
| 21 | #include <ui/Rect.h> |
| 22 | #include <ui/Region.h> |
| 23 | |
| 24 | namespace android { |
| 25 | namespace renderengine { |
| 26 | |
| 27 | // DisplaySettings contains the settings that are applicable when drawing all |
| 28 | // layers for a given display. |
| 29 | struct DisplaySettings { |
| 30 | // Rectangle describing the physical display. We will project from the |
| 31 | // logical clip onto this rectangle. |
| Alec Mouri | 1441bf7 | 2018-12-03 19:55:28 -0800 | [diff] [blame] | 32 | Rect physicalDisplay = Rect::INVALID_RECT; |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 33 | |
| 34 | // Rectangle bounded by the x,y- clipping planes in the logical display, so |
| 35 | // that the orthographic projection matrix can be computed. When |
| 36 | // constructing this matrix, z-coordinate bound are assumed to be at z=0 and |
| 37 | // z=1. |
| Alec Mouri | 1441bf7 | 2018-12-03 19:55:28 -0800 | [diff] [blame] | 38 | Rect clip = Rect::INVALID_RECT; |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 39 | |
| 40 | // Global transform to apply to all layers. |
| Alec Mouri | 1441bf7 | 2018-12-03 19:55:28 -0800 | [diff] [blame] | 41 | mat4 globalTransform = mat4(); |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 42 | |
| 43 | // Maximum luminance pulled from the display's HDR capabilities. |
| Alec Mouri | 1089aed | 2018-10-25 21:33:57 -0700 | [diff] [blame] | 44 | float maxLuminance = 1.0f; |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 45 | |
| 46 | // Output dataspace that will be populated if wide color gamut is used, or |
| 47 | // DataSpace::UNKNOWN otherwise. |
| Alec Mouri | 1441bf7 | 2018-12-03 19:55:28 -0800 | [diff] [blame] | 48 | ui::Dataspace outputDataspace = ui::Dataspace::UNKNOWN; |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 49 | |
| 50 | // Additional color transform to apply in linear space after transforming |
| 51 | // to the output dataspace. |
| Alec Mouri | 1441bf7 | 2018-12-03 19:55:28 -0800 | [diff] [blame] | 52 | mat4 colorTransform = mat4(); |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 53 | |
| Alec Mouri | ac33553 | 2018-11-12 15:01:33 -0800 | [diff] [blame] | 54 | // Region that will be cleared to (0, 0, 0, 1) prior to rendering. |
| 55 | // RenderEngine will transform the clearRegion passed in here, by |
| 56 | // globalTransform, so that it will be in the same coordinate space as the |
| 57 | // rendered layers. |
| Alec Mouri | 1441bf7 | 2018-12-03 19:55:28 -0800 | [diff] [blame] | 58 | Region clearRegion = Region::INVALID_REGION; |
| Alec Mouri | 6e57f68 | 2018-09-29 20:45:08 -0700 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | } // namespace renderengine |
| 62 | } // namespace android |