diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 22:21:46 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 22:21:46 +0000 |
commit | e51bdf3d4f7bb89497344af0b4a99ff10512c0d5 (patch) | |
tree | f8ea1734e59c778c3acc8b9a4454789c526f15bd /gpu/command_buffer/service/feature_info.cc | |
parent | b898f0108b4e39bb86577455470dd42490ff1b7b (diff) | |
download | chromium_src-e51bdf3d4f7bb89497344af0b4a99ff10512c0d5.zip chromium_src-e51bdf3d4f7bb89497344af0b4a99ff10512c0d5.tar.gz chromium_src-e51bdf3d4f7bb89497344af0b4a99ff10512c0d5.tar.bz2 |
Added minimal support to command buffer for GL_ARB_texture_rectangle
textures, and added Mac OS X-specific extension for binding IOSurfaces
to textures. This is infrastructure work for rendering Core Animation
plugins via Chrome's compositor.
Refactored the texture initialization in the command buffer and
associated unit tests. Added unit tests for rectangular textures.
These changes will be hooked up in a subsequent CL. They were split
off for easier review.
There are ongoing discussions about unifying the various mechanisms
for sharing textures across processes, but it's been agreed that those
should not block this work.
BUG=38967
TEST=GPU unit tests; manual testing with forthcoming changes
Review URL: http://codereview.chromium.org/8680002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/feature_info.cc')
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 6b26b91..66c05a8 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -8,6 +8,9 @@ #include "gpu/command_buffer/service/gl_utils.h" #include "ui/gfx/gl/gl_context.h" #include "ui/gfx/gl/gl_implementation.h" +#if defined(OS_MACOSX) +#include "ui/gfx/surface/io_surface_support_mac.h" +#endif namespace gpu { namespace gles2 { @@ -354,6 +357,30 @@ void FeatureInfo::AddFeatures(const char* desired_features) { feature_flags_.chromium_stream_texture = true; } + // Ideally we would only expose this extension on Mac OS X, to + // support GL_CHROMIUM_iosurface and the compositor. We don't want + // applications to start using it; they should use ordinary non- + // power-of-two textures. However, for unit testing purposes we + // expose it on all supported platforms. + if (ext.HaveAndDesire("GL_ARB_texture_rectangle")) { + AddExtensionString("GL_ARB_texture_rectangle"); + feature_flags_.arb_texture_rectangle = true; + validators_.texture_bind_target.AddValue(GL_TEXTURE_RECTANGLE_ARB); + // For the moment we don't add this enum to the texture_target + // validator. This implies that the only way to get image data into a + // rectangular texture is via glTexImageIOSurface2DCHROMIUM, which is + // just fine since again we don't want applications depending on this + // extension. + validators_.get_tex_param_target.AddValue(GL_TEXTURE_RECTANGLE_ARB); + validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_RECTANGLE_ARB); + } + +#if defined(OS_MACOSX) + if (IOSurfaceSupport::Initialize()) { + AddExtensionString("GL_CHROMIUM_iosurface"); + } +#endif + // TODO(gman): Add support for these extensions. // GL_OES_depth32 // GL_OES_element_index_uint |