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

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: also stretch the video for YUV_RESOURCE 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 39b8ef20c59f072bcbc8f6815aa9d66ea8a82edb..fe9e85c7aab177f68d7202d2dbfa76f16ad7839b 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -184,7 +184,12 @@ void VideoLayerImpl::AppendQuads(RenderPass* render_pass,
if (visible_quad_rect.IsEmpty())
return;
- // Pixels for macroblocked formats.
+ // Pixels for macroblocked formats. To prevent sampling outside the visible
+ // rect, stretch the video if needed.
+ if (visible_rect.width() < coded_size.width() && visible_rect.width() > 1)
+ visible_rect.set_width(visible_rect.width() - 1);
+ if (visible_rect.height() < coded_size.height() && visible_rect.height() > 1)
+ visible_rect.set_height(visible_rect.height() - 1);
const float tex_width_scale =
static_cast<float>(visible_rect.width()) / coded_size.width();
const float tex_height_scale =
« 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