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

Unified Diff: ui/gfx/ozone/dri/dri_surface_factory.cc

Issue 205433005: ozone: Add OzoneWindowFactory & OzoneWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/ozone/dri/dri_surface_factory.cc
diff --git a/ui/gfx/ozone/dri/dri_surface_factory.cc b/ui/gfx/ozone/dri/dri_surface_factory.cc
index 911d341634a728e8de1186fc2b93a3b5c274c7be..7854f1cdafeec4c5aecb21f37bb132689ee497f7 100644
--- a/ui/gfx/ozone/dri/dri_surface_factory.cc
+++ b/ui/gfx/ozone/dri/dri_surface_factory.cc
@@ -26,7 +26,8 @@ namespace {
const char kDefaultGraphicsCardPath[] = "/dev/dri/card0";
const char kDPMSProperty[] = "DPMS";
-const gfx::AcceleratedWidget kDefaultWidgetHandle = 1;
+const gfx::AcceleratedWidget kDefaultWidgetHandle =
+ kDefaultAcceleratedWidgetForSingleWindow;
// TODO(dnicoara) Read the cursor plane size from the hardware.
const gfx::Size kCursorSize(64, 64);
@@ -178,6 +179,12 @@ DriSurfaceFactory::InitializeHardware() {
return state_;
}
+ // TODO(dnicoara) When there's more information on which display we want,
+ // then we can return the widget associated with the display.
+ // For now just assume we have 1 display device and return it.
+ if (!controller_.get())
+ controller_.reset(new HardwareDisplayController());
+
state_ = INITIALIZED;
return state_;
}
@@ -194,12 +201,6 @@ void DriSurfaceFactory::ShutdownHardware() {
gfx::AcceleratedWidget DriSurfaceFactory::GetAcceleratedWidget() {
CHECK(state_ != FAILED);
- // TODO(dnicoara) When there's more information on which display we want,
- // then we can return the widget associated with the display.
- // For now just assume we have 1 display device and return it.
- if (!controller_.get())
- controller_.reset(new HardwareDisplayController());
-
// TODO(dnicoara) We only have 1 display for now, so only 1 AcceleratedWidget.
// When we'll support multiple displays this needs to be changed to return a
// different handle for every display.

Powered by Google App Engine
This is Rietveld 408576698