diff options
author | kalyan.kondapally@intel.com <kalyan.kondapally@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-04 01:36:01 +0000 |
---|---|---|
committer | kalyan.kondapally@intel.com <kalyan.kondapally@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-04 01:36:01 +0000 |
commit | fe7d239b265fea334c1cd4bcccf1bd78ef74104d (patch) | |
tree | 1b5cd54a304cddd7f8c25b135ce934d418d17f65 | |
parent | 31a926929e77eed06cf47eea82d6a8c7f9509a0a (diff) | |
download | chromium_src-fe7d239b265fea334c1cd4bcccf1bd78ef74104d.zip chromium_src-fe7d239b265fea334c1cd4bcccf1bd78ef74104d.tar.gz chromium_src-fe7d239b265fea334c1cd4bcccf1bd78ef74104d.tar.bz2 |
Add support for over-riding config attribute values.
GLSurfaceEGL chooses a EGL frame buffer configuration that match
attributes specified in attrib list. This CL adds support for Ozone
implementations to provide values for these attributes as supported
by the underlying window system.
BUG=
Review URL: https://codereview.chromium.org/23850008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226925 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ui/gfx/ozone/surface_factory_ozone.cc | 5 | ||||
-rw-r--r-- | ui/gfx/ozone/surface_factory_ozone.h | 7 | ||||
-rw-r--r-- | ui/gl/gl_surface_egl.cc | 11 |
4 files changed, 22 insertions, 2 deletions
@@ -132,6 +132,7 @@ Joshua Roesslein <jroesslein@gmail.com> Josué Ratelle <jorat1346@gmail.com> Jun Jiang <jun.a.jiang@intel.com> Junmin Zhu <junmin.zhu@intel.com> +Kalyan Kondapally <kalyan.kondapally@intel.com> Kamil Jiwa <kamil.jiwa@gmail.com> Kangil Han <kangil.han@samsung.com> Kangyuan Shu <kangyuan.shu@intel.com> diff --git a/ui/gfx/ozone/surface_factory_ozone.cc b/ui/gfx/ozone/surface_factory_ozone.cc index 9be61f4..ca67228 100644 --- a/ui/gfx/ozone/surface_factory_ozone.cc +++ b/ui/gfx/ozone/surface_factory_ozone.cc @@ -69,6 +69,11 @@ bool SurfaceFactoryOzone::SchedulePageFlip(gfx::AcceleratedWidget) { return true; } +const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties( + const int32* desired_attributes) { + return desired_attributes; +} + // static SurfaceFactoryOzone* SurfaceFactoryOzone::CreateTestHelper() { return new SurfaceFactoryOzoneStub; diff --git a/ui/gfx/ozone/surface_factory_ozone.h b/ui/gfx/ozone/surface_factory_ozone.h index 9c5eac2..734c144 100644 --- a/ui/gfx/ozone/surface_factory_ozone.h +++ b/ui/gfx/ozone/surface_factory_ozone.h @@ -82,6 +82,13 @@ class GFX_EXPORT SurfaceFactoryOzone { // in InitializeHardware. Returns NULL on error. virtual gfx::VSyncProvider* GetVSyncProvider(gfx::AcceleratedWidget w) = 0; + // Returns an array of EGL properties, which can be used in any EGL function + // used to select a display configuration. Note that all properties should be + // immediately followed by the corresponding desired value and array should be + // terminated with EGL_NONE. Ownership of the array is not transferred to + // caller. desired_list contains list of desired EGL properties and values. + virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); + // Create a default SufaceFactoryOzone implementation useful for tests. static SurfaceFactoryOzone* CreateTestHelper(); diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index 0c1871e..7401fbb 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc @@ -145,9 +145,16 @@ bool GLSurfaceEGL::InitializeOneOff() { EGL_NONE }; +#if defined(USE_OZONE) + const EGLint* config_attribs = + surface_factory->GetEGLSurfaceProperties(kConfigAttribs); +#else + const EGLint* config_attribs = kConfigAttribs; +#endif + EGLint num_configs; if (!eglChooseConfig(g_display, - kConfigAttribs, + config_attribs, NULL, 0, &num_configs)) { @@ -162,7 +169,7 @@ bool GLSurfaceEGL::InitializeOneOff() { } if (!eglChooseConfig(g_display, - kConfigAttribs, + config_attribs, &g_config, 1, &num_configs)) { |