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_DRM_GPU_DRM_WINDOW_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 namespace gfx { | 23 namespace gfx { |
24 class Point; | 24 class Point; |
25 class Rect; | 25 class Rect; |
26 } // namespace gfx | 26 } // namespace gfx |
27 | 27 |
28 namespace ui { | 28 namespace ui { |
29 | 29 |
30 class DrmBuffer; | 30 class DrmBuffer; |
31 class DrmDevice; | 31 class DrmDevice; |
32 class DrmDeviceManager; | 32 class DrmDeviceManager; |
| 33 class DrmOverlayCandidate; |
33 class HardwareDisplayController; | 34 class HardwareDisplayController; |
34 struct OverlayCheck_Params; | 35 struct OverlayCheck_Params; |
35 class ScanoutBufferGenerator; | 36 class ScanoutBufferGenerator; |
36 class ScreenManager; | 37 class ScreenManager; |
37 | 38 |
38 // The GPU object representing a window. | 39 // The GPU object representing a window. |
39 // | 40 // |
40 // The main purpose of this object is to associate drawing surfaces with | 41 // The main purpose of this object is to associate drawing surfaces with |
41 // displays. A surface created with the same id as the window (from | 42 // displays. A surface created with the same id as the window (from |
42 // GetAcceleratedWidget()) will paint onto that window. A window with | 43 // GetAcceleratedWidget()) will paint onto that window. A window with |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // the bitmap is empty, the cursor is hidden. | 81 // the bitmap is empty, the cursor is hidden. |
81 void SetCursorWithoutAnimations(const std::vector<SkBitmap>& bitmaps, | 82 void SetCursorWithoutAnimations(const std::vector<SkBitmap>& bitmaps, |
82 const gfx::Point& location); | 83 const gfx::Point& location); |
83 | 84 |
84 // Move the HW cursor to the specified location. | 85 // Move the HW cursor to the specified location. |
85 void MoveCursor(const gfx::Point& location); | 86 void MoveCursor(const gfx::Point& location); |
86 | 87 |
87 void SchedulePageFlip(const std::vector<OverlayPlane>& planes, | 88 void SchedulePageFlip(const std::vector<OverlayPlane>& planes, |
88 const SwapCompletionCallback& callback); | 89 const SwapCompletionCallback& callback); |
89 std::vector<OverlayCheck_Params> TestPageFlip( | 90 std::vector<OverlayCheck_Params> TestPageFlip( |
90 const std::vector<OverlayCheck_Params>& planes, | 91 const std::vector<OverlayCheck_Params>& current_combination, |
| 92 const std::vector<OverlayCheck_Params>& new_combination, |
91 ScanoutBufferGenerator* buffer_generator); | 93 ScanoutBufferGenerator* buffer_generator); |
92 | 94 |
93 // Returns the last buffer associated with this window. | 95 // Returns the last buffer associated with this window. |
94 const OverlayPlane* GetLastModesetBuffer(); | 96 const OverlayPlane* GetLastModesetBuffer(); |
95 | 97 |
96 void GetVSyncParameters( | 98 void GetVSyncParameters( |
97 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const; | 99 const gfx::VSyncProvider::UpdateVSyncCallback& callback) const; |
98 | 100 |
| 101 // Returns optimal buffer configuration for the expected OverlayCandidates |
| 102 // which can be supported by the display on which this window is shown. |
| 103 void GetOverlayBufferConfigurations( |
| 104 const OverlayParamCallback& callback) const; |
| 105 |
99 private: | 106 private: |
100 // Draw the last set cursor & update the cursor plane. | 107 // Draw the last set cursor & update the cursor plane. |
101 void ResetCursor(bool bitmap_only); | 108 void ResetCursor(bool bitmap_only); |
102 | 109 |
103 // Draw next frame in an animated cursor. | 110 // Draw next frame in an animated cursor. |
104 void OnCursorAnimationTimeout(); | 111 void OnCursorAnimationTimeout(); |
105 | 112 |
106 // When |controller_| changes this is called to reallocate the cursor buffers | 113 // When |controller_| changes this is called to reallocate the cursor buffers |
107 // since the allocation DRM device may have changed. | 114 // since the allocation DRM device may have changed. |
108 void UpdateCursorBuffers(); | 115 void UpdateCursorBuffers(); |
109 | 116 |
110 gfx::AcceleratedWidget widget_; | 117 gfx::AcceleratedWidget widget_; |
111 | 118 |
112 DrmDeviceManager* device_manager_; // Not owned. | 119 DrmDeviceManager* device_manager_; // Not owned. |
113 ScreenManager* screen_manager_; // Not owned. | 120 ScreenManager* screen_manager_; // Not owned. |
114 | 121 |
115 // The current bounds of the window. | 122 // The current bounds of the window. |
116 gfx::Rect bounds_; | 123 gfx::Rect bounds_; |
117 | 124 |
118 // The controller associated with the current window. This may be nullptr if | 125 // The controller associated with the current window. This may be nullptr if |
119 // the window isn't over an active display. | 126 // the window isn't over an active display. |
120 HardwareDisplayController* controller_ = nullptr; | 127 HardwareDisplayController* controller_ = nullptr; |
| 128 scoped_ptr<DrmOverlayCandidate> overlay_validator_; |
121 | 129 |
122 base::RepeatingTimer cursor_timer_; | 130 base::RepeatingTimer cursor_timer_; |
123 | 131 |
124 scoped_refptr<DrmBuffer> cursor_buffers_[2]; | 132 scoped_refptr<DrmBuffer> cursor_buffers_[2]; |
125 int cursor_frontbuffer_ = 0; | 133 int cursor_frontbuffer_ = 0; |
126 | 134 |
127 std::vector<SkBitmap> cursor_bitmaps_; | 135 std::vector<SkBitmap> cursor_bitmaps_; |
128 gfx::Point cursor_location_; | 136 gfx::Point cursor_location_; |
129 int cursor_frame_ = 0; | 137 int cursor_frame_ = 0; |
130 int cursor_frame_delay_ms_ = 0; | 138 int cursor_frame_delay_ms_ = 0; |
131 | 139 |
132 OverlayPlaneList last_submitted_planes_; | 140 OverlayPlaneList last_submitted_planes_; |
133 | 141 |
134 bool force_buffer_reallocation_ = false; | 142 bool force_buffer_reallocation_ = false; |
135 | 143 |
136 DISALLOW_COPY_AND_ASSIGN(DrmWindow); | 144 DISALLOW_COPY_AND_ASSIGN(DrmWindow); |
137 }; | 145 }; |
138 | 146 |
139 } // namespace ui | 147 } // namespace ui |
140 | 148 |
141 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_H_ | 149 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_H_ |
OLD | NEW |