Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3241)

Unified Diff: cc/layers/video_layer_impl.cc

Issue 1645353003: VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check visible rect > 1,1 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698