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

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

Issue 2503283007: Work around unknown Mac Intel driver bug causing non-deterministic behavior in GPU readback from 2D (Closed)
Patch Set: address comments Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | 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 e54a4fb7fc4bec91d3c9595f280fb2c66c7bbbb6..cfb07c8fd3cc2d3a42a83add6e1a29da703ade3f 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -5058,9 +5058,16 @@ void WebGLRenderingContextBase::texImageHelperHTMLCanvasElement(
// float/integer/sRGB internal format.
// TODO(crbug.com/622958): relax the constrains if copyTextureCHROMIUM is
// upgraded to handle more formats.
- if (!canvas->renderingContext() ||
- !canvas->renderingContext()->isAccelerated() ||
- !canUseTexImageByGPU(functionID, internalformat, type)) {
+ bool forceSoftwareReadbackFrom2DCanvas =
+ this->canvas() && this->canvas()->document().settings() &&
+ this->canvas()
+ ->document()
+ .settings()
+ ->forceSoftwareReadbackFrom2DCanvas();
+ CanvasRenderingContext* sourceContext = canvas->renderingContext();
+ if (!sourceContext || !sourceContext->isAccelerated() ||
+ !canUseTexImageByGPU(functionID, internalformat, type) ||
+ (forceSoftwareReadbackFrom2DCanvas && sourceContext->is2d())) {
// 2D canvas has only FrontBuffer.
texImageImpl(functionID, target, level, internalformat, xoffset, yoffset,
zoffset, format, type,
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698