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

Unified Diff: cc/layers/video_layer_impl.cc

Issue 2463103002: Revert of Fix HTML5 video blurry (Closed)
Patch Set: Created 4 years, 1 month 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 | cc/output/gl_renderer.h » ('j') | 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 0095ac96ae6e415816eea5a95aacebc07e186c07..f1c118d32ae2ff52df77afdee6d1eb2b92fdac72 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -191,10 +191,15 @@
// Pixels for macroblocked formats. To prevent sampling outside the visible
// rect, stretch the video if needed.
+ gfx::Rect visible_sample_rect = frame_->visible_rect();
+ if (visible_rect.width() < coded_size.width() && visible_rect.width() > 1)
+ visible_sample_rect.set_width(visible_rect.width() - 1);
+ if (visible_rect.height() < coded_size.height() && visible_rect.height() > 1)
+ visible_sample_rect.set_height(visible_rect.height() - 1);
const float tex_width_scale =
- static_cast<float>(visible_rect.width()) / coded_size.width();
+ static_cast<float>(visible_sample_rect.width()) / coded_size.width();
const float tex_height_scale =
- static_cast<float>(visible_rect.height()) / coded_size.height();
+ static_cast<float>(visible_sample_rect.height()) / coded_size.height();
switch (frame_resource_type_) {
// TODO(danakj): Remove this, hide it in the hardware path.
@@ -260,12 +265,12 @@
static_cast<float>(ya_tex_size.width()) / uv_tex_size.width();
float uv_subsampling_factor_y =
static_cast<float>(ya_tex_size.height()) / uv_tex_size.height();
- gfx::RectF ya_tex_coord_rect(visible_rect);
+ gfx::RectF ya_tex_coord_rect(visible_sample_rect);
gfx::RectF uv_tex_coord_rect(
- visible_rect.x() / uv_subsampling_factor_x,
- visible_rect.y() / uv_subsampling_factor_y,
- visible_rect.width() / uv_subsampling_factor_x,
- visible_rect.height() / uv_subsampling_factor_y);
+ visible_sample_rect.x() / uv_subsampling_factor_x,
+ visible_sample_rect.y() / uv_subsampling_factor_y,
+ visible_sample_rect.width() / uv_subsampling_factor_x,
+ visible_sample_rect.height() / uv_subsampling_factor_y);
YUVVideoDrawQuad* yuv_video_quad =
render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
« no previous file with comments | « no previous file | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698