OSDN Git Service

Revert "Add nested display support in hwc"
[android-x86/external-IA-Hardware-Composer.git] / public / gpudevice.h
1 /*
2 // Copyright (c) 2016 Intel Corporation
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 #ifndef PUBLIC_GPUDEVICE_H_
18 #define PUBLIC_GPUDEVICE_H_
19
20 #include <stdint.h>
21 #include <fstream>
22 #include <string>
23 #include <sstream>
24
25 #include "displaymanager.h"
26 #include "logicaldisplaymanager.h"
27 #include "nativedisplay.h"
28
29 namespace hwcomposer {
30
31 class NativeDisplay;
32
33 class GpuDevice {
34  public:
35   GpuDevice();
36
37   virtual ~GpuDevice();
38
39   // Open device.
40   bool Initialize();
41
42   NativeDisplay* GetDisplay(uint32_t display);
43
44   NativeDisplay* GetVirtualDisplay();
45
46   void GetConnectedPhysicalDisplays(std::vector<NativeDisplay*>& displays);
47
48   std::vector<NativeDisplay*> GetAllDisplays();
49
50   void RegisterHotPlugEventCallback(
51       std::shared_ptr<DisplayHotPlugEventCallback> callback);
52
53  private:
54   std::unique_ptr<DisplayManager> display_manager_;
55   std::vector<std::unique_ptr<LogicalDisplayManager>> logical_display_manager_;
56   std::vector<std::unique_ptr<NativeDisplay>> mosaic_displays_;
57   std::vector<NativeDisplay*> total_displays_;
58   bool initialized_;
59 };
60
61 }  // namespace hwcomposer
62 #endif  // PUBLIC_GPUDEVICE_H_