Chromium Code Reviews| 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 |