blob: af8de2363c9e12731c98f9cb6af3ad1b558b4140 [file] [log] [blame]
Alec Mouri6e57f682018-09-29 20:45:08 -07001/*
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
24namespace android {
25namespace renderengine {
26
27// DisplaySettings contains the settings that are applicable when drawing all
28// layers for a given display.
29struct DisplaySettings {
30 // Rectangle describing the physical display. We will project from the
31 // logical clip onto this rectangle.
Alec Mouri1441bf72018-12-03 19:55:28 -080032 Rect physicalDisplay = Rect::INVALID_RECT;
Alec Mouri6e57f682018-09-29 20:45:08 -070033
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 Mouri1441bf72018-12-03 19:55:28 -080038 Rect clip = Rect::INVALID_RECT;
Alec Mouri6e57f682018-09-29 20:45:08 -070039
40 // Global transform to apply to all layers.
Alec Mouri1441bf72018-12-03 19:55:28 -080041 mat4 globalTransform = mat4();
Alec Mouri6e57f682018-09-29 20:45:08 -070042
43 // Maximum luminance pulled from the display's HDR capabilities.
Alec Mouri1089aed2018-10-25 21:33:57 -070044 float maxLuminance = 1.0f;
Alec Mouri6e57f682018-09-29 20:45:08 -070045
46 // Output dataspace that will be populated if wide color gamut is used, or
47 // DataSpace::UNKNOWN otherwise.
Alec Mouri1441bf72018-12-03 19:55:28 -080048 ui::Dataspace outputDataspace = ui::Dataspace::UNKNOWN;
Alec Mouri6e57f682018-09-29 20:45:08 -070049
50 // Additional color transform to apply in linear space after transforming
51 // to the output dataspace.
Alec Mouri1441bf72018-12-03 19:55:28 -080052 mat4 colorTransform = mat4();
Alec Mouri6e57f682018-09-29 20:45:08 -070053
Alec Mouriac335532018-11-12 15:01:33 -080054 // 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 Mouri1441bf72018-12-03 19:55:28 -080058 Region clearRegion = Region::INVALID_REGION;
Alec Mouri6e57f682018-09-29 20:45:08 -070059};
60
61} // namespace renderengine
62} // namespace android