Commit b6ab4acc authored by Fritz Koenig's avatar Fritz Koenig Committed by Commit Bot

Adjust rectangle for flipped sources in TexImage2D

When the source is a WebGL canvas the rectangle must
be adjusted for flipping with MESA_framebuffer_flip_y.

BUG=964010
TEST=https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html?version=2.0.1

Change-Id: I20f5ac0a5049b23b3033a6d46f53606886f4e4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627555Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665193}
parent a3c0a7dc
......@@ -5420,7 +5420,12 @@ void WebGLRenderingContextBase::TexImageHelperCanvasRenderingContextHost(
// The GPU-GPU copy path uses the Y-up coordinate system.
IntRect adjusted_source_sub_rectangle = source_sub_rectangle;
if (!unpack_flip_y_) {
bool should_adjust_source_sub_rectangle = !unpack_flip_y_;
if (is_origin_top_left_ && source_canvas_webgl_context)
should_adjust_source_sub_rectangle = !should_adjust_source_sub_rectangle;
if (should_adjust_source_sub_rectangle) {
adjusted_source_sub_rectangle.SetY(context_host->Size().Height() -
adjusted_source_sub_rectangle.MaxY());
}
......
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