OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_PROXY_H_ |
6 #define UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ | 6 #define UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_PROXY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "ui/display/types/chromeos/native_display_delegate.h" | 11 #include "ui/display/types/chromeos/native_display_delegate.h" |
12 #include "ui/events/ozone/device/device_event_observer.h" | 12 #include "ui/events/ozone/device/device_event_observer.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 class DeviceManager; | 16 class DeviceManager; |
17 class DisplaySnapshotDri; | 17 class GpuPlatformSupportHostGbm; |
18 class DriConsoleBuffer; | |
19 class DriWrapper; | |
20 class ScreenManager; | |
21 | 18 |
22 class NativeDisplayDelegateDri | 19 class NativeDisplayDelegateProxy |
23 : public NativeDisplayDelegate, DeviceEventObserver { | 20 : public NativeDisplayDelegate, DeviceEventObserver { |
24 public: | 21 public: |
25 NativeDisplayDelegateDri(DriWrapper* dri, | 22 NativeDisplayDelegateProxy(GpuPlatformSupportHostGbm* proxy, |
26 ScreenManager* screen_manager, | 23 DeviceManager* device_manager); |
27 DeviceManager* device_manager); | 24 virtual ~NativeDisplayDelegateProxy(); |
28 virtual ~NativeDisplayDelegateDri(); | 25 |
| 26 void OnUpdateNativeDisplays(ScopedVector<DisplaySnapshot> displays); |
29 | 27 |
30 // NativeDisplayDelegate overrides: | 28 // NativeDisplayDelegate overrides: |
31 virtual void Initialize() OVERRIDE; | 29 virtual void Initialize() OVERRIDE; |
32 virtual void GrabServer() OVERRIDE; | 30 virtual void GrabServer() OVERRIDE; |
33 virtual void UngrabServer() OVERRIDE; | 31 virtual void UngrabServer() OVERRIDE; |
34 virtual void SyncWithServer() OVERRIDE; | 32 virtual void SyncWithServer() OVERRIDE; |
35 virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE; | 33 virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE; |
36 virtual void ForceDPMSOn() OVERRIDE; | 34 virtual void ForceDPMSOn() OVERRIDE; |
37 virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE; | 35 virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE; |
38 virtual void AddMode(const DisplaySnapshot& output, | 36 virtual void AddMode(const DisplaySnapshot& output, |
39 const DisplayMode* mode) OVERRIDE; | 37 const DisplayMode* mode) OVERRIDE; |
40 virtual bool Configure(const DisplaySnapshot& output, | 38 virtual bool Configure(const DisplaySnapshot& output, |
41 const DisplayMode* mode, | 39 const DisplayMode* mode, |
42 const gfx::Point& origin) OVERRIDE; | 40 const gfx::Point& origin) OVERRIDE; |
43 virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE; | 41 virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE; |
44 virtual bool GetHDCPState(const DisplaySnapshot& output, | 42 virtual bool GetHDCPState(const DisplaySnapshot& output, |
45 HDCPState* state) OVERRIDE; | 43 HDCPState* state) OVERRIDE; |
46 virtual bool SetHDCPState(const DisplaySnapshot& output, | 44 virtual bool SetHDCPState(const DisplaySnapshot& output, |
47 HDCPState state) OVERRIDE; | 45 HDCPState state) OVERRIDE; |
48 virtual std::vector<ui::ColorCalibrationProfile> | 46 virtual std::vector<ColorCalibrationProfile> |
49 GetAvailableColorCalibrationProfiles( | 47 GetAvailableColorCalibrationProfiles( |
50 const ui::DisplaySnapshot& output) OVERRIDE; | 48 const DisplaySnapshot& output) OVERRIDE; |
51 virtual bool SetColorCalibrationProfile( | 49 virtual bool SetColorCalibrationProfile( |
52 const ui::DisplaySnapshot& output, | 50 const DisplaySnapshot& output, |
53 ui::ColorCalibrationProfile new_profile) OVERRIDE; | 51 ColorCalibrationProfile new_profile) OVERRIDE; |
54 virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; | 52 virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; |
55 virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; | 53 virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; |
56 | 54 |
57 // DeviceEventObserver overrides: | 55 // DeviceEventObserver overrides: |
58 virtual void OnDeviceEvent(const DeviceEvent& event) OVERRIDE; | 56 virtual void OnDeviceEvent(const DeviceEvent& event) OVERRIDE; |
59 | 57 |
60 private: | 58 private: |
61 // Notify ScreenManager of all the displays that were present before the | 59 GpuPlatformSupportHostGbm* proxy_; // Not owned. |
62 // update but are gone after the update. | |
63 void NotifyScreenManager( | |
64 const std::vector<DisplaySnapshotDri*>& new_displays, | |
65 const std::vector<DisplaySnapshotDri*>& old_displays) const; | |
66 | |
67 DriWrapper* dri_; // Not owned. | |
68 ScreenManager* screen_manager_; // Not owned. | |
69 DeviceManager* device_manager_; // Not owned. | 60 DeviceManager* device_manager_; // Not owned. |
70 scoped_ptr<DriConsoleBuffer> console_buffer_; | 61 ScopedVector<DisplaySnapshot> displays_; |
71 ScopedVector<const DisplayMode> cached_modes_; | |
72 ScopedVector<DisplaySnapshotDri> cached_displays_; | |
73 ObserverList<NativeDisplayObserver> observers_; | 62 ObserverList<NativeDisplayObserver> observers_; |
74 | 63 |
75 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateDri); | 64 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateProxy); |
76 }; | 65 }; |
77 | 66 |
78 } // namespace ui | 67 } // namespace ui |
79 | 68 |
80 #endif // UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ | 69 #endif // UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_PROXY_H_ |
OLD | NEW |