| 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();
|
|
|