Index: ui/gl/gl_image_io_surface.mm |
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm |
index fc4df49f478ff007cbbfd681ce8c63cd8493582d..8e208301e57902cad93055c22c1eff6bcc0ef8f7 100644 |
--- a/ui/gl/gl_image_io_surface.mm |
+++ b/ui/gl/gl_image_io_surface.mm |
@@ -168,9 +168,8 @@ GLenum DataType(gfx::BufferFormat format) { |
} |
// When an IOSurface is bound to a texture with internalformat "GL_RGB", many |
-// OpenGL operations are broken. Therefore, don't allow an IOSurface to be bound |
-// with GL_RGB unless overridden via BindTexImageWithInternalformat. |
-// crbug.com/595948, crbug.com/699566. |
+// OpenGL operations are broken. Therefore, never allow an IOSurface to be bound |
+// with GL_RGB. https://crbug.com/595948. |
GLenum ConvertRequestedInternalFormat(GLenum internalformat) { |
if (internalformat == GL_RGB) |
return GL_RGBA; |
@@ -238,11 +237,6 @@ unsigned GLImageIOSurface::GetInternalFormat() { |
} |
bool GLImageIOSurface::BindTexImage(unsigned target) { |
- return BindTexImageWithInternalformat(target, 0); |
-} |
- |
-bool GLImageIOSurface::BindTexImageWithInternalformat(unsigned target, |
- unsigned internalformat) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
TRACE_EVENT0("gpu", "GLImageIOSurface::BindTexImage"); |
base::TimeTicks start_time = base::TimeTicks::Now(); |
@@ -264,12 +258,10 @@ bool GLImageIOSurface::BindTexImageWithInternalformat(unsigned target, |
static_cast<CGLContextObj>(GLContext::GetCurrent()->GetHandle()); |
DCHECK(io_surface_); |
- |
- GLenum texture_format = |
- internalformat ? internalformat : TextureFormat(format_); |
- CGLError cgl_error = CGLTexImageIOSurface2D( |
- cgl_context, target, texture_format, size_.width(), size_.height(), |
- DataFormat(format_), DataType(format_), io_surface_.get(), 0); |
+ CGLError cgl_error = |
+ CGLTexImageIOSurface2D(cgl_context, target, TextureFormat(format_), |
+ size_.width(), size_.height(), DataFormat(format_), |
+ DataType(format_), io_surface_.get(), 0); |
if (cgl_error != kCGLNoError) { |
LOG(ERROR) << "Error in CGLTexImageIOSurface2D: " |
<< CGLErrorString(cgl_error); |