Commit 6f719904 authored by Michael Ludwig's avatar Michael Ludwig Committed by Commit Bot

Fix YUV quad texture coordinate generation

It is supposed to use params.visible_rect instead of quad->visible_rect
to get the correct relative relationship between the original rectangle
and the texture coordinates. If params.visible_rect isn't used, when
a scissor test was explicitly applied, ScaleRectProportional would not
calculate the proper visible texture coordinates (basically it would
think the visible rectangle hadn't been clipped from the original).

Bug: 948225
Change-Id: I426443484f5f0b8391e23fe38e29328807e5a2fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546785
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646515}
parent 396cf92f
...@@ -1290,8 +1290,7 @@ void SkiaRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad, ...@@ -1290,8 +1290,7 @@ void SkiaRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
return; return;
gfx::RectF visible_tex_coord_rect = cc::MathUtil::ScaleRectProportional( gfx::RectF visible_tex_coord_rect = cc::MathUtil::ScaleRectProportional(
quad->ya_tex_coord_rect, gfx::RectF(quad->rect), quad->ya_tex_coord_rect, gfx::RectF(quad->rect), params.visible_rect);
gfx::RectF(quad->visible_rect));
SkPaint paint = params.paint(); SkPaint paint = params.paint();
if (color_filter) if (color_filter)
......
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