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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1405013002: Update texImage2DCanvasByGPU path in texImage2D/texSubImage2D for WebGL 2.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 43cecb80cf7d1dea7439344d236cedbc0d454db0..0de5488462291f5864fd1871561c42d985e8374c 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -4353,9 +4353,11 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in
WebGLTexture* texture = validateTextureBinding("texImage2D", target, true);
ASSERT(texture);
- // texImage2DCanvasByGPU relies on copyTextureCHROMIUM which doesn't support float type.
- bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_HALF_FLOAT_OES;
- if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerated() || isFloatType) {
+ // texImage2DCanvasByGPU relies on copyTextureCHROMIUM which doesn't support float/integer type and sRGB internal format.
+ bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_HALF_FLOAT_OES || type == GL_UNSIGNED_INT_10F_11F_11F_REV;
+ bool isIntegerFormat = format == GL_RED_INTEGER || format == GL_RG_INTEGER || format == GL_RGB_INTEGER || format == GL_RGBA_INTEGER;
+ bool isSRGBFormat = internalformat == GL_SRGB8 || internalformat == GL_SRGB8_ALPHA8 || internalformat == GL_SRGB || internalformat == GL_SRGB_ALPHA_EXT;
+ if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerated() || isFloatType || isIntegerFormat || isSRGBFormat) {
bajones 2015/10/15 17:17:58 The newly added format checks make this difficult
qiankun 2015/10/16 17:19:35 Done.
// 2D canvas has only FrontBuffer.
texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(FrontBuffer, PreferAcceleration).get(),
WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha);
@@ -4611,8 +4613,11 @@ void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint
WebGLTexture* texture = validateTextureBinding("texSubImage2D", target, true);
ASSERT(texture);
- bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_HALF_FLOAT_OES;
- if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerated() || isFloatType) {
+ GLenum internalformat = texture->getInternalFormat(target, level);
+ bool isFloatType = type == GL_FLOAT || type == GL_HALF_FLOAT || type == GL_HALF_FLOAT_OES || type == GL_UNSIGNED_INT_10F_11F_11F_REV;
+ bool isIntegerFormat = format == GL_RED_INTEGER || format == GL_RG_INTEGER || format == GL_RGB_INTEGER || format == GL_RGBA_INTEGER;
+ bool isSRGBFormat = internalformat == GL_SRGB8 || internalformat == GL_SRGB8_ALPHA8 || internalformat == GL_SRGB || internalformat == GL_SRGB_ALPHA_EXT;
+ if (!canvas->renderingContext() || !canvas->renderingContext()->isAccelerated() || isFloatType || isIntegerFormat || isSRGBFormat) {
bajones 2015/10/15 17:17:58 Same here.
qiankun 2015/10/16 17:19:35 Done.
// 2D canvas has only FrontBuffer.
texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(FrontBuffer, PreferAcceleration).get(),
WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698