Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: ui/ozone/platform/dri/native_display_delegate_dri.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_DRI_H_
6 #define UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_DRI_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h"
10 #include "base/observer_list.h"
11 #include "ui/display/types/native_display_delegate.h"
12 #include "ui/events/ozone/device/device_event_observer.h"
13
14 namespace ui {
15
16 class DeviceManager;
17 class DisplaySnapshotDri;
18 class DriConsoleBuffer;
19 class DriWrapper;
20 class ScreenManager;
21
22 class NativeDisplayDelegateDri : public NativeDisplayDelegate,
23 DeviceEventObserver {
24 public:
25 NativeDisplayDelegateDri(DriWrapper* dri,
26 ScreenManager* screen_manager,
27 DeviceManager* device_manager);
28 virtual ~NativeDisplayDelegateDri();
29
30 DisplaySnapshot* FindDisplaySnapshot(int64_t id);
31 const DisplayMode* FindDisplayMode(const gfx::Size& size,
32 bool is_interlaced,
33 float refresh_rate);
34
35 // NativeDisplayDelegate overrides:
36 virtual void Initialize() override;
37 virtual void GrabServer() override;
38 virtual void UngrabServer() override;
39 virtual void SyncWithServer() override;
40 virtual void SetBackgroundColor(uint32_t color_argb) override;
41 virtual void ForceDPMSOn() override;
42 virtual std::vector<DisplaySnapshot*> GetDisplays() override;
43 virtual void AddMode(const DisplaySnapshot& output,
44 const DisplayMode* mode) override;
45 virtual bool Configure(const DisplaySnapshot& output,
46 const DisplayMode* mode,
47 const gfx::Point& origin) override;
48 virtual void CreateFrameBuffer(const gfx::Size& size) override;
49 virtual bool GetHDCPState(const DisplaySnapshot& output,
50 HDCPState* state) override;
51 virtual bool SetHDCPState(const DisplaySnapshot& output,
52 HDCPState state) override;
53 virtual std::vector<ui::ColorCalibrationProfile>
54 GetAvailableColorCalibrationProfiles(
55 const ui::DisplaySnapshot& output) override;
56 virtual bool SetColorCalibrationProfile(
57 const ui::DisplaySnapshot& output,
58 ui::ColorCalibrationProfile new_profile) override;
59 virtual void AddObserver(NativeDisplayObserver* observer) override;
60 virtual void RemoveObserver(NativeDisplayObserver* observer) override;
61
62 // DeviceEventObserver overrides:
63 virtual void OnDeviceEvent(const DeviceEvent& event) override;
64
65 private:
66 // Notify ScreenManager of all the displays that were present before the
67 // update but are gone after the update.
68 void NotifyScreenManager(
69 const std::vector<DisplaySnapshotDri*>& new_displays,
70 const std::vector<DisplaySnapshotDri*>& old_displays) const;
71
72 DriWrapper* dri_; // Not owned.
73 ScreenManager* screen_manager_; // Not owned.
74 DeviceManager* device_manager_; // Not owned.
75 scoped_ptr<DriConsoleBuffer> console_buffer_;
76 // Modes can be shared between different displays, so we need to keep track
77 // of them independently for cleanup.
78 ScopedVector<const DisplayMode> cached_modes_;
79 ScopedVector<DisplaySnapshotDri> cached_displays_;
80 ObserverList<NativeDisplayObserver> observers_;
81
82 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateDri);
83 };
84
85 } // namespace ui
86
87 #endif // UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_DRI_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/hardware_display_plane_manager.cc ('k') | ui/ozone/platform/dri/native_display_delegate_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698