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

Unified Diff: cc/layers/video_layer_impl.cc

Issue 207233002: cc: Support texcoord offsets in YUVVideoDrawQuad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c7cdf916 Rebase. Created 6 years, 9 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 | 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 6bc4b2f82c07a11445e3dd179a6893f4e62b37f9..cf71c3c6b532317e081b03cd83e6b83ef7fef5a5 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -139,10 +139,14 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink,
gfx::Size coded_size = frame_->coded_size();
// Pixels for macroblocked formats.
- float tex_width_scale =
+ const float tex_width_scale =
static_cast<float>(visible_rect.width()) / coded_size.width();
- float tex_height_scale =
+ const float tex_height_scale =
static_cast<float>(visible_rect.height()) / coded_size.height();
+ const float tex_x_offset =
+ static_cast<float>(visible_rect.x()) / coded_size.width();
+ const float tex_y_offset =
+ static_cast<float>(visible_rect.y()) / coded_size.height();
switch (frame_resource_type_) {
// TODO(danakj): Remove this, hide it in the hardware path.
@@ -175,14 +179,15 @@ void VideoLayerImpl::AppendQuads(QuadSink* quad_sink,
DCHECK_GE(frame_resources_.size(), 3u);
if (frame_resources_.size() < 3u)
break;
- gfx::SizeF tex_scale(tex_width_scale, tex_height_scale);
+ gfx::RectF tex_coord_rect(
+ tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale);
scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create();
yuv_video_quad->SetNew(
shared_quad_state,
quad_rect,
opaque_rect,
visible_quad_rect,
- tex_scale,
+ tex_coord_rect,
frame_resources_[0],
frame_resources_[1],
frame_resources_[2],
« 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