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

Unified Diff: cc/layers/video_layer.cc

Issue 388643002: Rotation into Video Layer + Content Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated layer{impl} tests Created 6 years, 5 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
Index: cc/layers/video_layer.cc
diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc
index 4ddfdae69a64f9f4514b7d18be20d1083ba7a1fe..6da8928065f7d78fe58a06ceb1b3c745cd8dee7b 100644
--- a/cc/layers/video_layer.cc
+++ b/cc/layers/video_layer.cc
@@ -36,4 +36,34 @@ bool VideoLayer::Update(ResourceUpdateQueue* queue,
return updated;
}
+void VideoLayer::PushPropertiesTo(LayerImpl* impl) {
+ Layer::PushPropertiesTo(impl);
+ gfx::Transform transform = impl->transform();
+ bool transform_is_invertible = impl->transform_is_invertible();
+ gfx::Size content_bounds = impl->content_bounds();
+
+ switch (video_rotation_) {
+ case media::VIDEO_ROTATION_90:
+ transform.Rotate(90.0);
+ transform.Translate(0.0, -content_bounds.width());
+ content_bounds =
enne (OOO) 2014/07/23 21:46:52 I think content bounds shouldn't be modified here.
suderman 2014/07/23 23:27:01 The content bounds are used to construct the video
enne (OOO) 2014/07/23 23:39:26 Thanks! That was not obvious at all to me. So, Bl
+ gfx::Size(content_bounds.height(), content_bounds.width());
+ break;
+ case media::VIDEO_ROTATION_180:
+ transform.Rotate(180.0);
+ transform.Translate(-content_bounds.width(), -content_bounds.height());
+ break;
+ case media::VIDEO_ROTATION_270:
+ transform.Rotate(270.0);
+ transform.Translate(-content_bounds.height(), 0);
+ content_bounds =
+ gfx::Size(content_bounds.height(), content_bounds.width());
+ case media::VIDEO_ROTATION_0:
+ break;
+ }
+
+ impl->draw_properties().content_bounds = content_bounds;
+ impl->SetTransformAndInvertibility(transform, transform_is_invertible);
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698