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

Unified Diff: ui/ozone/platform/dri/dri_wrapper.h

Issue 856423002: [Ozone-Dri] Decouple the IO helper thread from DriWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gbm-wrapper
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_helper_thread.cc ('k') | ui/ozone/platform/dri/dri_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_wrapper.h
diff --git a/ui/ozone/platform/dri/dri_wrapper.h b/ui/ozone/platform/dri/dri_wrapper.h
index 0dfa86691363cdc21a7fca32d84cc669ed4ef790..381459ee7e0b3476ec14f3e569ac9ab14dffc803 100644
--- a/ui/ozone/platform/dri/dri_wrapper.h
+++ b/ui/ozone/platform/dri/dri_wrapper.h
@@ -12,7 +12,6 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
-#include "base/threading/thread.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/overlay_transform.h"
@@ -24,6 +23,10 @@ typedef struct _drmModeModeInfo drmModeModeInfo;
struct SkImageInfo;
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
namespace ui {
class HardwareDisplayPlaneManager;
@@ -37,12 +40,16 @@ class DriWrapper {
unsigned int /* seconds */,
unsigned int /* useconds */)> PageFlipCallback;
- DriWrapper(const char* device_path, bool use_sync_flips);
+ DriWrapper(const char* device_path);
virtual ~DriWrapper();
// Open device.
virtual void Initialize();
+ // |task_runner| will be used to asynchronously page flip.
+ virtual void InitializeTaskRunner(
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+
// Get the CRTC state. This is generally used to save state before using the
// CRTC. When the user finishes using the CRTC, the user should restore the
// CRTC to it's initial state. Use |SetCrtc| to restore the state.
@@ -152,10 +159,6 @@ class DriWrapper {
HardwareDisplayPlaneManager* plane_manager() { return plane_manager_.get(); }
protected:
- // Responsible for late initialization of the IO thread. This needs to happen
- // after the sandbox is up, thus the late initialization.
- virtual void InitializeIOWatcher();
-
// The file descriptor associated with this wrapper. All DRM operations will
// be performed using this FD.
// TODO(dnicoara) Make this a base::File
@@ -163,9 +166,6 @@ class DriWrapper {
scoped_ptr<HardwareDisplayPlaneManager> plane_manager_;
- // If we need to block when performing page flips this is set to true.
- bool use_sync_flips_;
-
private:
class IOWatcher;
@@ -173,9 +173,7 @@ class DriWrapper {
const char* device_path_;
// Helper thread to perform IO listener operations.
- // TODO(dnicoara) This should really be supported by the main thread.
- // Alternatively we should have a way to access the IO thread's task runner.
- base::Thread io_thread_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
// Watcher for |fd_| listening for page flip events.
scoped_refptr<IOWatcher> watcher_;
« no previous file with comments | « ui/ozone/platform/dri/dri_helper_thread.cc ('k') | ui/ozone/platform/dri/dri_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698