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

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

Issue 132543002: Not for review. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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 4c20137394220e0b8297ebdbc1cf77db0b2a0b8d..a3a8282c433ca561c3f3ae7fc1972285fae61c25 100644
--- a/ui/gfx/ozone/dri/dri_surface_factory.cc
+++ b/ui/gfx/ozone/dri/dri_surface_factory.cc
@@ -169,22 +169,21 @@ gfx::AcceleratedWidget DriSurfaceFactory::RealizeAcceleratedWidget(
}
// Create a surface suitable for the current controller.
- scoped_ptr<DriSurface> surface(CreateSurface(controller_.get()));
+ scoped_ptr<ScanoutSurface> surface(CreateSurface(controller_.get()));
if (!surface->Initialize()) {
LOG(ERROR) << "Failed to initialize surface";
return gfx::kNullAcceleratedWidget;
}
- // Bind the surface to the controller. This will register the backing buffers
- // with the hardware CRTC such that we can show the buffers. The controller
- // takes ownership of the surface.
+ // Bind the surface to the controller. The controller takes ownership of the
+ // surface.
if (!controller_->BindSurfaceToController(surface.Pass())) {
LOG(ERROR) << "Failed to bind surface to controller";
return gfx::kNullAcceleratedWidget;
}
- return reinterpret_cast<gfx::AcceleratedWidget>(controller_->get_surface());
+ return GetNativeWidget(controller_->get_surface());
}
bool DriSurfaceFactory::LoadEGLGLES2Bindings(
@@ -203,7 +202,7 @@ bool DriSurfaceFactory::SchedulePageFlip(gfx::AcceleratedWidget w) {
CHECK(state_ == INITIALIZED);
// TODO(dnicoara) Change this CHECK once we're running with the threaded
// compositor.
- CHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI);
+ //CHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI);
// TODO(dnicoara) Once we can handle multiple displays this needs to be
// changed.
@@ -246,7 +245,7 @@ gfx::VSyncProvider* DriSurfaceFactory::GetVSyncProvider(
////////////////////////////////////////////////////////////////////////////////
// DriSurfaceFactory private
-DriSurface* DriSurfaceFactory::CreateSurface(
+ScanoutSurface* DriSurfaceFactory::CreateSurface(
HardwareDisplayController* controller) {
return new DriSurface(controller);
}
@@ -255,6 +254,11 @@ DriWrapper* DriSurfaceFactory::CreateWrapper() {
return new DriWrapper(kDefaultGraphicsCardPath);
}
+gfx::AcceleratedWidget DriSurfaceFactory::GetNativeWidget(
+ ScanoutSurface* surface) {
+ return reinterpret_cast<gfx::AcceleratedWidget>(surface);
+}
+
bool DriSurfaceFactory::InitializeControllerForPrimaryDisplay(
DriWrapper* drm,
HardwareDisplayController* controller) {

Powered by Google App Engine
This is Rietveld 408576698