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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 13886018: Add a factory and defines for native Linux surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vsync provider, better transport_dib, etc. Created 7 years, 7 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
« ui/gl/gl_surface.h ('K') | « ui/gl/gl_surface_egl.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_android.cc b/ui/gl/gl_surface_ozone.cc
similarity index 78%
copy from ui/gl/gl_surface_android.cc
copy to ui/gl/gl_surface_ozone.cc
index 6c2565798a375b2b97783fe2612244314824fce9..40e0ec8cf18d954b4ec24f6d9abd5850992117f6 100644
--- a/ui/gl/gl_surface_android.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -1,13 +1,12 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gl/gl_surface.h"
-#include <EGL/egl.h>
-
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "ui/base/ozone/surface_factory_ozone.h"
rjkroege 2013/05/17 22:17:06 I'm not convinced that this file is worth refactor
piman 2013/05/18 01:47:19 TBH, with the suggested change to pass the VSyncPr
rjkroege 2013/05/21 17:36:28 Done.
#include "ui/gl/egl_util.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
@@ -26,6 +25,7 @@ bool GLSurface::InitializeOneOffInternal() {
switch (GetGLImplementation()) {
case kGLImplementationEGLGLES2:
+ ui::SurfaceFactory::GetInstance()->InitializeHardware();
if (!GLSurfaceEGL::InitializeOneOff()) {
LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
return false;
@@ -39,6 +39,7 @@ bool GLSurface::InitializeOneOffInternal() {
initialized = true;
return true;
}
+
// static
scoped_refptr<GLSurface>
GLSurface::CreateViewGLSurface(bool software, gfx::AcceleratedWidget window) {
@@ -52,7 +53,15 @@ GLSurface::CreateViewGLSurface(bool software, gfx::AcceleratedWidget window) {
surface = new NativeViewGLSurfaceEGL(false, window);
else
surface = new GLSurfaceStub();
- if (!surface->Initialize())
+ bool success;
+ if (GLSurfaceEGL::IsSyncControlSupported()) {
+ success = surface->Initialize();
+ } else {
+ VSyncProvider* sync_provider =
+ ui::SurfaceFactory::GetInstance()->GetVSyncProvider(window);
+ success = surface->Initialize(sync_provider);
+ }
+ if (!success)
return NULL;
return surface;
}
« ui/gl/gl_surface.h ('K') | « ui/gl/gl_surface_egl.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698