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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 750593003: Ozone X11 platform Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup leftover stuff Created 6 years 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/gl/gl_surface_egl.cc ('k') | ui/ozone/BUILD.gn » ('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_ozone.cc b/ui/gl/gl_surface_ozone.cc
index 67ab131b7a8c261905ca7fe5bc0a5aef855e2adb..929d9af36f53a9230f4cd03a6c67f8bb3d0cf888 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -4,9 +4,11 @@
#include "ui/gl/gl_surface.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gl/egl_util.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
#include "ui/gl/gl_implementation.h"
@@ -57,6 +59,22 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
widget_, z_order, transform, bounds_rect, crop_rect);
}
+ EGLConfig GetConfig() override {
+ if (!config_) {
+ ui::SurfaceFactoryOzone::EglConfigInfo egl;
+ egl.choose_config = base::Bind(&GLSurfaceOzoneEGL::EglChooseConfig,
+ base::Unretained(this));
+ egl.get_config_attribute = base::Bind(
+ &GLSurfaceOzoneEGL::EglGetConfigAttribute, base::Unretained(this));
+ egl.get_last_error_string = base::Bind(&ui::GetLastEGLErrorString);
+ config_ = ui::SurfaceFactoryOzone::GetInstance()->GetEGLSurfaceConfig(
+ egl, ozone_surface_.get());
+ }
+ if (config_)
+ return config_;
+ return NativeViewGLSurfaceEGL::GetConfig();
+ }
+
private:
using NativeViewGLSurfaceEGL::Initialize;
@@ -64,6 +82,20 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
Destroy(); // EGL surface must be destroyed before SurfaceOzone
}
+ bool EglChooseConfig(const int32* attribs,
+ void** /* EGLConfig* */ configs,
+ int32 config_size,
+ int32* num_configs) {
+ return eglChooseConfig(GetDisplay(), attribs, configs, config_size,
+ num_configs);
+ }
+
+ bool EglGetConfigAttribute(void* /* EGLConfig */ config,
+ int32 attribute,
+ int32* value) {
+ return eglGetConfigAttrib(GetDisplay(), config, attribute, value);
+ }
+
bool ReinitializeNativeSurface() {
scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current;
GLContext* current_context = GLContext::GetCurrent();
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/ozone/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698