blob: dbcd3bd5f790ed83f02e89214d13979b99ec44bd [file] [log] [blame]
Lloyd Pique45a165a2018-10-19 11:54:47 -07001/*
2 * Copyright 2019 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 <cstdint>
20#include <optional>
21
22#include "DisplayHardware/DisplayIdentification.h"
23
Lloyd Pique32cbe282018-10-19 13:09:22 -070024#include <compositionengine/Output.h>
25
Lloyd Pique45a165a2018-10-19 11:54:47 -070026namespace android::compositionengine {
27
Lloyd Pique31cb2942018-10-19 17:23:03 -070028struct RenderSurfaceCreationArgs;
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070029struct DisplayColorProfileCreationArgs;
Lloyd Pique31cb2942018-10-19 17:23:03 -070030
Lloyd Pique45a165a2018-10-19 11:54:47 -070031/**
32 * A display is a composition target which may be backed by a hardware composer
33 * display device
34 */
Lloyd Pique32cbe282018-10-19 13:09:22 -070035class Display : public virtual Output {
Lloyd Pique45a165a2018-10-19 11:54:47 -070036public:
37 // Gets the HWC DisplayId for the display if there is one
38 virtual const std::optional<DisplayId>& getId() const = 0;
39
40 // True if the display is secure
41 virtual bool isSecure() const = 0;
42
43 // True if the display is virtual
44 virtual bool isVirtual() const = 0;
45
46 // Releases the use of the HWC display, if any
47 virtual void disconnect() = 0;
48
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070049 // Creates a render color mode for the display
50 virtual void createDisplayColorProfile(DisplayColorProfileCreationArgs&&) = 0;
51
52 // Creates a render surface for the display
Lloyd Pique31cb2942018-10-19 17:23:03 -070053 virtual void createRenderSurface(RenderSurfaceCreationArgs&&) = 0;
54
Lloyd Pique45a165a2018-10-19 11:54:47 -070055protected:
56 ~Display() = default;
57};
58
59} // namespace android::compositionengine