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

Unified Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

Issue 150083005: Use GL_chromium_color_buffer_float extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months 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
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContext.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 56668d64afea6676d30de39aca0c725e38bc20be..e418968e6f3dac4bf7a82b3db7c9374395d675ac 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -3313,6 +3313,18 @@ void WebGLRenderingContext::stencilOpSeparate(GLenum face, GLenum fail, GLenum z
m_context->stencilOpSeparate(face, fail, zfail, zpass);
}
+GLenum WebGLRenderingContext::convertTexInternalFormat(GLenum internalformat, GLenum type)
+{
+ // Convert to sized internal formats that are renderable with GL_CHROMIUM_color_buffer_float_rgb(a).
+ if (type == GL_FLOAT && internalformat == GL_RGBA
+ && m_contextSupport->isExtensionEnabled("GL_CHROMIUM_color_buffer_float_rgba"))
+ return GL_RGBA32F_EXT;
+ if (type == GL_FLOAT && internalformat == GL_RGB
+ && m_contextSupport->isExtensionEnabled("GL_CHROMIUM_color_buffer_float_rgb"))
+ return GL_RGB32F_EXT;
+ return internalformat;
Ken Russell (switch to Gerrit) 2014/02/11 23:46:52 There aren't any queries whose results need to be
oetuaho-nv 2014/02/12 12:45:36 I couldn't find any other calls where conversions
+}
+
void WebGLRenderingContext::texImage2DBase(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels, ExceptionState& exceptionState)
{
// All calling functions check isContextLost, so a duplicate check is not needed here.
@@ -3322,8 +3334,7 @@ void WebGLRenderingContext::texImage2DBase(GLenum target, GLint level, GLenum in
ASSERT(tex);
ASSERT(!level || !WebGLTexture::isNPOT(width, height));
ASSERT(!pixels || validateSettableTexFormat("texImage2D", internalformat));
- m_context->texImage2D(target, level, internalformat, width, height,
- border, format, type, pixels);
+ m_context->texImage2D(target, level, convertTexInternalFormat(internalformat, type), width, height, border, format, type, pixels);
tex->setLevelInfo(target, level, internalformat, width, height, type);
}
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698