Commit 82b85825 authored by Fritz Koenig's avatar Fritz Koenig Committed by Commit Bot

webgl: LowLatency and toDataURL work nicely together

There is a lot of flipping going on when using the
GL_MESA_framebuffer_flip_y extension.  toDataURL and
LowLatency have competing requirments when calling
CopyToPlatformTexture.

https://codepen.io/miguelao/full/WKZaqd
https://www.khronos.org/registry/webgl/sdk/tests/conformance/canvas/to-data-url-test.html

BUG=883362

Change-Id: Iafe11c23591a79f696b652a57f2d083258d3aa9c
Reviewed-on: https://chromium-review.googlesource.com/1237248Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593223}
parent a6ed7ce8
......@@ -1602,8 +1602,9 @@ bool WebGLRenderingContextBase::CopyRenderingResultsFromDrawingBuffer(
// CopyToPlatformTexture is done correctly. See crbug.com/794706.
gl->Flush();
bool flip_y = is_origin_top_left_ && !canvas()->LowLatencyEnabled();
return drawing_buffer_->CopyToPlatformTexture(
gl, GL_TEXTURE_2D, texture_id, true, is_origin_top_left_,
gl, GL_TEXTURE_2D, texture_id, true, flip_y,
IntPoint(0, 0), IntRect(IntPoint(0, 0), drawing_buffer_->Size()),
source_buffer);
}
......@@ -5198,7 +5199,7 @@ void WebGLRenderingContextBase::TexImageViaGPU(
IntPoint(xoffset, yoffset), source_sub_rectangle);
} else {
WebGLRenderingContextBase* gl = source_canvas_webgl_context;
if (gl->is_origin_top_left_)
if (gl->is_origin_top_left_ && !canvas()->LowLatencyEnabled())
flip_y = !flip_y;
ScopedTexture2DRestorer restorer(gl);
if (!gl->GetDrawingBuffer()->CopyToPlatformTexture(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment