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

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

Issue 2547013002: Add Intel macOS workaround for WebGL2 canvas_sub_rectangle tests (Closed)
Patch Set: add comments Created 4 years 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: 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 99ce2366d8a5c6e0ba444cb93e3265fc061f68e5..61c04afc8b86c269af57215443b2fe5d1a27839f 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -5004,7 +5004,14 @@ void WebGLRenderingContextBase::texImageHelperHTMLCanvasElement(
unpackImageHeight, &selectingSubRectangle)) {
return;
}
-
+ bool forceRedundant2dCanvasCopy =
+ this->canvas() && this->canvas()->document().settings() &&
+ this->canvas()->document().settings()->forceRedundant2dCanvasCopy();
+ AccelerationHint hint;
+ if (forceRedundant2dCanvasCopy)
+ hint = PreferAccelerationWithExtraSurfaceCopy;
+ else
+ hint = PreferAcceleration;
if (functionID == TexImage2D || functionID == TexSubImage2D) {
// texImageByGPU relies on copyTextureCHROMIUM which doesn't support
// float/integer/sRGB internal format.
@@ -5016,7 +5023,7 @@ void WebGLRenderingContextBase::texImageHelperHTMLCanvasElement(
// 2D canvas has only FrontBuffer.
texImageImpl(functionID, target, level, internalformat, xoffset, yoffset,
zoffset, format, type,
- canvas->copiedImage(FrontBuffer, PreferAcceleration).get(),
+ canvas->copiedImage(FrontBuffer, hint).get(),
WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY,
m_unpackPremultiplyAlpha, sourceSubRectangle, 1, 0);
return;
@@ -5044,12 +5051,11 @@ void WebGLRenderingContextBase::texImageHelperHTMLCanvasElement(
// TODO(zmo): Implement GPU-to-GPU copy path (crbug.com/612542).
// Note that code will also be needed to copy to layers of 3D
// textures, and elements of 2D texture arrays.
- texImageImpl(functionID, target, level, internalformat, xoffset, yoffset,
- zoffset, format, type,
- canvas->copiedImage(FrontBuffer, PreferAcceleration).get(),
- WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY,
- m_unpackPremultiplyAlpha, sourceSubRectangle, depth,
- unpackImageHeight);
+ texImageImpl(
+ functionID, target, level, internalformat, xoffset, yoffset, zoffset,
+ format, type, canvas->copiedImage(FrontBuffer, hint).get(),
+ WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY,
+ m_unpackPremultiplyAlpha, sourceSubRectangle, depth, unpackImageHeight);
}
}

Powered by Google App Engine
This is Rietveld 408576698