Chromium Code Reviews| Index: cc/layers/video_layer_impl.cc |
| diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc |
| index d173cc6c2b6d0f511a802fb95d167aed98f9a1d1..e893c5fab2654f54b9f482f100a292ab7e278ae7 100644 |
| --- a/cc/layers/video_layer_impl.cc |
| +++ b/cc/layers/video_layer_impl.cc |
| @@ -185,10 +185,15 @@ void VideoLayerImpl::AppendQuads(RenderPass* render_pass, |
| return; |
| // Pixels for macroblocked formats. |
| - const float tex_width_scale = |
| - static_cast<float>(visible_rect.width()) / coded_size.width(); |
| - const float tex_height_scale = |
| - static_cast<float>(visible_rect.height()) / coded_size.height(); |
| + float visible_width = static_cast<float>(visible_rect.width()); |
|
enne (OOO)
2016/02/01 21:00:03
Please leave these as ints and put the static cast
wuchengli
2016/02/02 05:37:27
Done.
|
| + float visible_height = static_cast<float>(visible_rect.height()); |
| + // To prevent sampling outside the visible rect, stretch the video if needed. |
| + if (visible_rect.width() < coded_size.width() && visible_rect.width() > 1) |
| + visible_width -= 1.f; |
|
wuchengli
2016/02/01 03:29:51
Do we want this for RGB_RESOURCE only or for all f
enne (OOO)
2016/02/01 21:00:03
If you do this here, it will be for all formats bu
wuchengli
2016/02/02 05:37:27
Done.
|
| + if (visible_rect.height() < coded_size.height() && visible_rect.height() > 1) |
| + visible_height -= 1.f; |
| + const float tex_width_scale = visible_width / coded_size.width(); |
| + const float tex_height_scale = visible_height / coded_size.height(); |
| switch (frame_resource_type_) { |
| // TODO(danakj): Remove this, hide it in the hardware path. |