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

Unified Diff: ui/ozone/common/gl_ozone_egl.cc

Issue 2270463002: Add OzoneGLImpl interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 3 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/common/gl_ozone_egl.h ('k') | ui/ozone/platform/x11/x11_surface_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/common/gl_ozone_egl.cc
diff --git a/ui/ozone/common/gl_ozone_egl.cc b/ui/ozone/common/gl_ozone_egl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..012a92e7c0f9a5896e0b5828777601f9924fe187
--- /dev/null
+++ b/ui/ozone/common/gl_ozone_egl.cc
@@ -0,0 +1,67 @@
+// Copyright 2016 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/ozone/common/gl_ozone_egl.h"
+
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_context_egl.h"
+#include "ui/gl/gl_egl_api_implementation.h"
+#include "ui/gl/gl_gl_api_implementation.h"
+#include "ui/gl/gl_share_group.h"
+#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_surface_egl.h"
+
+namespace ui {
+
+bool GLOzoneEGL::InitializeGLOneOffPlatform() {
+ if (!gl::GLSurfaceEGL::InitializeOneOff(GetNativeDisplay())) {
+ LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
+ return false;
+ }
+ return true;
+}
+
+bool GLOzoneEGL::InitializeStaticGLBindings(
+ gl::GLImplementation implementation) {
+ if (!LoadGLES2Bindings())
+ return false;
+
+ gl::SetGLImplementation(gl::kGLImplementationEGLGLES2);
+ gl::InitializeStaticGLBindingsGL();
+ gl::InitializeStaticGLBindingsEGL();
+
+ return true;
+}
+
+void GLOzoneEGL::InitializeDebugGLBindings() {
+ gl::InitializeDebugGLBindingsGL();
+ gl::InitializeDebugGLBindingsEGL();
+}
+
+void GLOzoneEGL::ClearGLBindings() {
+ gl::ClearGLBindingsGL();
+ gl::ClearGLBindingsEGL();
+}
+
+bool GLOzoneEGL::GetGLWindowSystemBindingInfo(
+ gl::GLWindowSystemBindingInfo* info) {
+ return gl::GetGLWindowSystemBindingInfoEGL(info);
+}
+
+scoped_refptr<gl::GLContext> GLOzoneEGL::CreateGLContext(
+ gl::GLShareGroup* share_group,
+ gl::GLSurface* compatible_surface,
+ gl::GpuPreference gpu_preference) {
+ return gl::InitializeGLContext(new gl::GLContextEGL(share_group),
+ compatible_surface, gpu_preference);
+}
+
+scoped_refptr<gl::GLSurface> GLOzoneEGL::CreateSurfacelessViewGLSurface(
+ gfx::AcceleratedWidget window) {
+ // This will usually not be implemented by the platform specific version.
+ return nullptr;
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/common/gl_ozone_egl.h ('k') | ui/ozone/platform/x11/x11_surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698