Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
index 19aadf286fa5b3efba8b72fa32c7eee092ff3bc8..94681269af44bff59e5b010c36bac9c700dfb42f 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -65,7 +65,9 @@ |
#include "ui/gl/gl_surface.h" |
#if defined(OS_MACOSX) |
-#include "ui/gl/io_surface_support_mac.h" |
+#include <IOSurface/IOSurfaceAPI.h> |
+// Note that this must be included after gl_bindings.h to avoid conflicts. |
+#include <OpenGL/CGLIOSurface.h> |
#endif |
#if defined(OS_WIN) |
@@ -1760,7 +1762,7 @@ class GLES2DecoderImpl : public GLES2Decoder, |
bool service_logging_; |
#if defined(OS_MACOSX) |
- typedef std::map<GLuint, CFTypeRef> TextureToIOSurfaceMap; |
+ typedef std::map<GLuint, IOSurfaceRef> TextureToIOSurfaceMap; |
TextureToIOSurfaceMap texture_to_io_surface_map_; |
#endif |
@@ -9751,7 +9753,7 @@ void GLES2DecoderImpl::ReleaseIOSurfaceForTexture(GLuint texture_id) { |
texture_id); |
if (it != texture_to_io_surface_map_.end()) { |
// Found a previous IOSurface bound to this texture; release it. |
- CFTypeRef surface = it->second; |
+ IOSurfaceRef surface = it->second; |
CFRelease(surface); |
texture_to_io_surface_map_.erase(it); |
} |
@@ -9769,14 +9771,6 @@ void GLES2DecoderImpl::DoTexImageIOSurface2DCHROMIUM( |
return; |
} |
- IOSurfaceSupport* surface_support = IOSurfaceSupport::Initialize(); |
- if (!surface_support) { |
- LOCAL_SET_GL_ERROR( |
- GL_INVALID_OPERATION, |
- "glTexImageIOSurface2DCHROMIUM", "only supported on 10.6."); |
- return; |
- } |
- |
if (target != GL_TEXTURE_RECTANGLE_ARB) { |
// This might be supported in the future, and if we could require |
// support for binding an IOSurface to a NPOT TEXTURE_2D texture, we |
@@ -9805,7 +9799,7 @@ void GLES2DecoderImpl::DoTexImageIOSurface2DCHROMIUM( |
// plugin process might allocate and release an IOSurface before |
// this process gets a chance to look it up. Hold on to any old |
// IOSurface in this case. |
- CFTypeRef surface = surface_support->IOSurfaceLookup(io_surface_id); |
+ IOSurfaceRef surface = IOSurfaceLookup(io_surface_id); |
if (!surface) { |
LOCAL_SET_GL_ERROR( |
GL_INVALID_OPERATION, |
@@ -9823,7 +9817,7 @@ void GLES2DecoderImpl::DoTexImageIOSurface2DCHROMIUM( |
CGLContextObj context = |
static_cast<CGLContextObj>(context_->GetHandle()); |
- CGLError err = surface_support->CGLTexImageIOSurface2D( |
+ CGLError err = CGLTexImageIOSurface2D( |
context, |
target, |
GL_RGBA, |