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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 23438002: Adding functionality to paint and signal buffer swap for ozone surface factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed SwapBuffers to SchedulePageFlip Created 7 years, 4 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/base/ozone/surface_factory_ozone.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 8c29342ab408e2f0e10fb0ff370807d449c5646c..456ad34f27bfb230b7e3a1fe95a23e1b0131245f 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -100,10 +100,6 @@ bool GLSurfaceEGL::InitializeOneOff() {
if (initialized)
return true;
-#if defined (USE_OZONE)
- ui::SurfaceFactoryOzone::GetInstance()->InitializeHardware();
-#endif
-
#if defined(USE_X11)
g_native_display = base::MessagePumpForUI::GetDefaultXDisplay();
#elif defined(OS_WIN)
@@ -111,6 +107,16 @@ bool GLSurfaceEGL::InitializeOneOff() {
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11)) {
g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE;
}
+#elif defined(USE_OZONE)
+ ui::SurfaceFactoryOzone* surface_factory =
+ ui::SurfaceFactoryOzone::GetInstance();
+ if (surface_factory->InitializeHardware() !=
+ ui::SurfaceFactoryOzone::INITIALIZED) {
+ LOG(ERROR) << "OZONE failed to initialize hardware";
+ return false;
+ }
+ g_native_display = reinterpret_cast<EGLNativeDisplayType>(
+ surface_factory->GetNativeDisplay());
#else
g_native_display = EGL_DEFAULT_DISPLAY;
#endif
@@ -362,6 +368,13 @@ bool NativeViewGLSurfaceEGL::SwapBuffers() {
return false;
}
+#if defined(USE_OZONE)
+ if (!ui::SurfaceFactoryOzone::GetInstance()->SchedulePageFlip(window_)) {
piman 2013/08/28 19:18:57 This is weird. Why isn't it done by eglSwapBuffers
dnicoara 2013/08/29 21:27:14 Removed.
+ DVLOG(1) << "Ozone failed to SchedulePageFlip";
+ return false;
+ }
+#endif
+
return true;
}
« no previous file with comments | « ui/base/ozone/surface_factory_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698