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

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

Issue 960273003: ozone: dri: add synchronous SwapBuffers support on surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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_HARDWARE_DISPLAY_CONTROLLER_H_ 5 #ifndef UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_
6 #define UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ 6 #define UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <xf86drmMode.h> 10 #include <xf86drmMode.h>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // should not be modified in any way as it would cause screen tearing if the 118 // should not be modified in any way as it would cause screen tearing if the
119 // hardware performed the flip. Note that the frontbuffer should also not 119 // hardware performed the flip. Note that the frontbuffer should also not
120 // be modified as it could still be displayed. 120 // be modified as it could still be displayed.
121 // 121 //
122 // Note that this function does not block. Also, this function should not be 122 // Note that this function does not block. Also, this function should not be
123 // called again before the page flip occurrs. 123 // called again before the page flip occurrs.
124 // 124 //
125 // Returns true if the page flip was successfully registered, false otherwise. 125 // Returns true if the page flip was successfully registered, false otherwise.
126 bool SchedulePageFlip(const base::Closure& callback); 126 bool SchedulePageFlip(const base::Closure& callback);
127 127
128 // Like |SchedulePageFlip| but synchronous.
129 bool PageFlip();
130
128 // Set the hardware cursor to show the contents of |surface|. 131 // Set the hardware cursor to show the contents of |surface|.
129 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer); 132 bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer);
130 133
131 bool UnsetCursor(); 134 bool UnsetCursor();
132 135
133 // Moves the hardware cursor to |location|. 136 // Moves the hardware cursor to |location|.
134 bool MoveCursor(const gfx::Point& location); 137 bool MoveCursor(const gfx::Point& location);
135 138
136 void AddCrtc(scoped_ptr<CrtcController> controller); 139 void AddCrtc(scoped_ptr<CrtcController> controller);
137 scoped_ptr<CrtcController> RemoveCrtc(const scoped_refptr<DriWrapper>& drm, 140 scoped_ptr<CrtcController> RemoveCrtc(const scoped_refptr<DriWrapper>& drm,
(...skipping 13 matching lines...) Expand all
151 const std::vector<CrtcController*>& crtc_controllers() const { 154 const std::vector<CrtcController*>& crtc_controllers() const {
152 return crtc_controllers_.get(); 155 return crtc_controllers_.get();
153 } 156 }
154 157
155 scoped_refptr<DriWrapper> GetAllocationDriWrapper() const; 158 scoped_refptr<DriWrapper> GetAllocationDriWrapper() const;
156 159
157 private: 160 private:
158 // Returns true if any of the CRTCs is waiting for a page flip. 161 // Returns true if any of the CRTCs is waiting for a page flip.
159 bool HasPendingPageFlips() const; 162 bool HasPendingPageFlips() const;
160 163
161 bool ActualSchedulePageFlip(); 164 bool ActualSchedulePageFlip(bool is_sync);
162 165
163 void ProcessPageFlipRequest(); 166 void ProcessPageFlipRequest();
164 167
165 void ClearPendingRequests(); 168 void ClearPendingRequests();
166 169
167 // PageFlipObserver: 170 // PageFlipObserver:
168 void OnPageFlipEvent() override; 171 void OnPageFlipEvent() override;
169 172
170 struct PageFlipRequest { 173 struct PageFlipRequest {
171 PageFlipRequest(const OverlayPlaneList& planes, 174 PageFlipRequest(const OverlayPlaneList& planes,
(...skipping 25 matching lines...) Expand all
197 drmModeModeInfo mode_; 200 drmModeModeInfo mode_;
198 201
199 bool is_disabled_; 202 bool is_disabled_;
200 203
201 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); 204 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController);
202 }; 205 };
203 206
204 } // namespace ui 207 } // namespace ui
205 208
206 #endif // UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ 209 #endif // UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698