summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authormagjed <magjed@chromium.org>2015-03-27 02:11:08 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-27 09:11:45 +0000
commit7364ff94a2bd814dd198f609f8d5bacabe1d563b (patch)
tree5dbc3187940087cf98113685698cfa26e8b15710 /mojo
parentda4c3f4269fbac2fe1b31e41a29d27bec8d5ec9d (diff)
downloadchromium_src-7364ff94a2bd814dd198f609f8d5bacabe1d563b.zip
chromium_src-7364ff94a2bd814dd198f609f8d5bacabe1d563b.tar.gz
chromium_src-7364ff94a2bd814dd198f609f8d5bacabe1d563b.tar.bz2
Increase YUV video clamping
The current clamping is not enough to avoid bleeding issues. This is exposed when changing the background color in CreateEdgeBleedPass from black to gray. The reason it works now is because interpolating U/V textures from black (YUV = 0, 0, 0) to green (YUV = 149, 43, 21) will still result in saturated green pixels (RGB = 0, 255, 0). All YUV values in the range (149, 0-43, 0-21) will end up as RGB = (0, 255, 0). The current clamping is not enough, because the calculation '0.5f / quad->tex_size.width()' is using the Y texture size, the highest resolution plane, but the U/V texture size is only half of that. This CL adds individual sizes for the Y/A and U/V textures. BUG=429640,467283 Committed: https://crrev.com/4be817dd606efdba1614d32608ddd6e16bfa687d Cr-Commit-Position: refs/heads/master@{#320567} Review URL: https://codereview.chromium.org/1008493002 Cr-Commit-Position: refs/heads/master@{#322541}
Diffstat (limited to 'mojo')
-rw-r--r--mojo/converters/surfaces/surfaces_type_converters.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/mojo/converters/surfaces/surfaces_type_converters.cc b/mojo/converters/surfaces/surfaces_type_converters.cc
index c09d117..3874e6a 100644
--- a/mojo/converters/surfaces/surfaces_type_converters.cc
+++ b/mojo/converters/surfaces/surfaces_type_converters.cc
@@ -174,7 +174,8 @@ bool ConvertDrawQuad(const QuadPtr& input,
input->visible_rect.To<gfx::Rect>(),
input->needs_blending,
yuv_state->tex_coord_rect.To<gfx::RectF>(),
- gfx::Size(), // TODO(jamesr): texture size
+ gfx::Size(), // TODO(jamesr): ya texture size
+ gfx::Size(), // TODO(jamesr): uv texture size
yuv_state->y_plane_resource_id,
yuv_state->u_plane_resource_id,
yuv_state->v_plane_resource_id,