| 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_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ | 5 #ifndef UI_DISPLAY_MANAGER_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ |
| 6 #define UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ | 6 #define UI_DISPLAY_MANAGER_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/event_types.h" | 16 #include "base/event_types.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 20 #include "ui/display/display_export.h" | 20 #include "ui/display/manager/display_manager_export.h" |
| 21 #include "ui/display/types/native_display_delegate.h" | 21 #include "ui/display/types/native_display_delegate.h" |
| 22 #include "ui/gfx/geometry/point.h" | 22 #include "ui/gfx/geometry/point.h" |
| 23 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 24 #include "ui/gfx/x/x11_types.h" | 24 #include "ui/gfx/x/x11_types.h" |
| 25 | 25 |
| 26 // Forward declarations for Xlib and Xrandr. | 26 // Forward declarations for Xlib and Xrandr. |
| 27 // This is so unused X definitions don't pollute the namespace. | 27 // This is so unused X definitions don't pollute the namespace. |
| 28 typedef XID RROutput; | 28 typedef XID RROutput; |
| 29 typedef XID RRCrtc; | 29 typedef XID RRCrtc; |
| 30 typedef XID RRMode; | 30 typedef XID RRMode; |
| 31 typedef XID _Window; | 31 typedef XID _Window; |
| 32 | 32 |
| 33 struct _XRROutputInfo; | 33 struct _XRROutputInfo; |
| 34 typedef _XRROutputInfo XRROutputInfo; | 34 typedef _XRROutputInfo XRROutputInfo; |
| 35 struct _XRRScreenResources; | 35 struct _XRRScreenResources; |
| 36 typedef _XRRScreenResources XRRScreenResources; | 36 typedef _XRRScreenResources XRRScreenResources; |
| 37 struct _XRRCrtcGamma; | 37 struct _XRRCrtcGamma; |
| 38 typedef _XRRCrtcGamma XRRCrtcGamma; | 38 typedef _XRRCrtcGamma XRRCrtcGamma; |
| 39 | 39 |
| 40 extern "C" { | 40 extern "C" { |
| 41 void XRRFreeScreenResources(XRRScreenResources* resources); | 41 void XRRFreeScreenResources(XRRScreenResources* resources); |
| 42 } | 42 } |
| 43 | 43 |
| 44 namespace ui { | 44 namespace ui { |
| 45 | 45 |
| 46 class DisplayModeX11; | 46 class DisplayModeX11; |
| 47 class DisplaySnapshotX11; | 47 class DisplaySnapshotX11; |
| 48 class NativeDisplayEventDispatcherX11; | 48 class NativeDisplayEventDispatcherX11; |
| 49 | 49 |
| 50 class DISPLAY_EXPORT NativeDisplayDelegateX11 : public NativeDisplayDelegate { | 50 class DISPLAY_MANAGER_EXPORT NativeDisplayDelegateX11 |
| 51 : public NativeDisplayDelegate { |
| 51 public: | 52 public: |
| 52 // Helper class that allows NativeDisplayEventDispatcherX11 and | 53 // Helper class that allows NativeDisplayEventDispatcherX11 and |
| 53 // NativeDisplayDelegateX11::PlatformEventObserverX11 to interact with this | 54 // NativeDisplayDelegateX11::PlatformEventObserverX11 to interact with this |
| 54 // class or with mocks in tests. | 55 // class or with mocks in tests. |
| 55 class HelperDelegate { | 56 class HelperDelegate { |
| 56 public: | 57 public: |
| 57 virtual ~HelperDelegate() {} | 58 virtual ~HelperDelegate() {} |
| 58 | 59 |
| 59 // Tells XRandR to update its configuration in response to |event|, an | 60 // Tells XRandR to update its configuration in response to |event|, an |
| 60 // RRScreenChangeNotify event. | 61 // RRScreenChangeNotify event. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 // Helper functions that perform the actual HDCP requests. | 133 // Helper functions that perform the actual HDCP requests. |
| 133 bool GetHDCPState(const DisplaySnapshot& output, HDCPState* state); | 134 bool GetHDCPState(const DisplaySnapshot& output, HDCPState* state); |
| 134 bool SetHDCPState(const DisplaySnapshot& output, HDCPState state); | 135 bool SetHDCPState(const DisplaySnapshot& output, HDCPState state); |
| 135 | 136 |
| 136 // Returns whether |id| is configured to preserve aspect when scaling. | 137 // Returns whether |id| is configured to preserve aspect when scaling. |
| 137 bool IsOutputAspectPreservingScaling(RROutput id); | 138 bool IsOutputAspectPreservingScaling(RROutput id); |
| 138 | 139 |
| 139 // Creates the gamma ramp for |new_profile|, or NULL if it doesn't exist. | 140 // Creates the gamma ramp for |new_profile|, or NULL if it doesn't exist. |
| 140 // The caller should take the ownership. | 141 // The caller should take the ownership. |
| 141 XRRCrtcGamma* CreateGammaRampForProfile( | 142 XRRCrtcGamma* CreateGammaRampForProfile(const DisplaySnapshotX11& x11_output, |
| 142 const DisplaySnapshotX11& x11_output, | 143 ColorCalibrationProfile new_profile); |
| 143 ColorCalibrationProfile new_profile); | |
| 144 | 144 |
| 145 void DrawBackground(); | 145 void DrawBackground(); |
| 146 | 146 |
| 147 XDisplay* display_; | 147 XDisplay* display_; |
| 148 _Window window_; | 148 _Window window_; |
| 149 | 149 |
| 150 // Initialized when the server is grabbed and freed when it's ungrabbed. | 150 // Initialized when the server is grabbed and freed when it's ungrabbed. |
| 151 gfx::XScopedPtr< | 151 gfx::XScopedPtr< |
| 152 XRRScreenResources, | 152 XRRScreenResources, |
| 153 gfx::XObjectDeleter<XRRScreenResources, void, XRRFreeScreenResources>> | 153 gfx::XObjectDeleter<XRRScreenResources, void, XRRFreeScreenResources>> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 170 base::ObserverList<NativeDisplayObserver> observers_; | 170 base::ObserverList<NativeDisplayObserver> observers_; |
| 171 | 171 |
| 172 // A background color used during boot time + multi displays. | 172 // A background color used during boot time + multi displays. |
| 173 uint32_t background_color_argb_; | 173 uint32_t background_color_argb_; |
| 174 | 174 |
| 175 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateX11); | 175 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateX11); |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 } // namespace ui | 178 } // namespace ui |
| 179 | 179 |
| 180 #endif // UI_DISPLAY_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ | 180 #endif // UI_DISPLAY_MANAGER_CHROMEOS_X11_NATIVE_DISPLAY_DELEGATE_X11_H_ |
| OLD | NEW |