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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 8680002: Added minimal support to command buffer for GL_ARB_texture_rectangle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
Index: gpu/command_buffer/service/feature_info.cc
===================================================================
--- gpu/command_buffer/service/feature_info.cc (revision 111321)
+++ gpu/command_buffer/service/feature_info.cc (working copy)
@@ -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 @@
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

Powered by Google App Engine
This is Rietveld 408576698