Chromium Code Reviews| Index: cc/layers/video_layer_impl.cc |
| diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc |
| index 7b4234c870cc023429578a807918edc4a9739bdf..a91592e16ad85625ed6c94e9644bcd87aed872be 100644 |
| --- a/cc/layers/video_layer_impl.cc |
| +++ b/cc/layers/video_layer_impl.cc |
| @@ -37,8 +37,8 @@ scoped_ptr<VideoLayerImpl> VideoLayerImpl::Create( |
| } |
| VideoLayerImpl::VideoLayerImpl(LayerTreeImpl* tree_impl, int id) |
| - : LayerImpl(tree_impl, id), |
| - frame_(NULL) {} |
| + : LayerImpl(tree_impl, id), frame_(NULL) { |
| +} |
| VideoLayerImpl::~VideoLayerImpl() { |
| if (!provider_client_impl_->Stopped()) { |
| @@ -55,7 +55,9 @@ VideoLayerImpl::~VideoLayerImpl() { |
| scoped_ptr<LayerImpl> VideoLayerImpl::CreateLayerImpl( |
| LayerTreeImpl* tree_impl) { |
| - return scoped_ptr<LayerImpl>(new VideoLayerImpl(tree_impl, id())); |
| + VideoLayerImpl* impl = new VideoLayerImpl(tree_impl, id()); |
| + impl->set_video_rotation(video_rotation_); |
|
enne (OOO)
2014/07/21 23:42:49
Properties should get pushed in push properties, n
suderman
2014/07/22 00:05:20
ditto
|
| + return scoped_ptr<LayerImpl>(impl); |
| } |
| void VideoLayerImpl::PushPropertiesTo(LayerImpl* layer) { |
| @@ -134,16 +136,44 @@ void VideoLayerImpl::AppendQuads( |
| render_pass->CreateAndAppendSharedQuadState(); |
| PopulateSharedQuadState(shared_quad_state); |
| + gfx::Transform transform = draw_transform(); |
|
enne (OOO)
2014/07/22 21:10:39
I think you also need to move the draw transform o
suderman
2014/07/22 21:48:16
I'll move the transform into push properties and (
suderman
2014/07/22 22:53:59
Unfortunately draw_transform is not set via PushPr
enne (OOO)
2014/07/22 22:55:37
Sorry, I was trying to suggest that you modify Lay
|
| + transform.Scale(content_bounds().width(), content_bounds().height()); |
| + |
| + switch (video_rotation_) { |
| + case media::VIDEO_ROTATION_90: |
| + transform.Rotate(90.0); |
| + transform.Translate(0.0, -1.0); |
| + break; |
| + case media::VIDEO_ROTATION_180: |
| + transform.Rotate(180.0); |
| + transform.Translate(-1.0, -1.0); |
| + break; |
| + case media::VIDEO_ROTATION_270: |
| + transform.Rotate(270.0); |
| + transform.Translate(-1.0, 0); |
| + case media::VIDEO_ROTATION_0: |
| + break; |
| + } |
| + |
| + shared_quad_state->SetAll(transform, |
| + content_bounds(), |
| + visible_content_rect(), |
|
enne (OOO)
2014/07/21 23:42:49
This seems a bit wrong. Quad rects and visible co
suderman
2014/07/22 00:05:20
Previous version used width/height translation w/o
|
| + clip_rect(), |
| + is_clipped(), |
| + draw_opacity(), |
| + blend_mode(), |
| + sorting_context_id()); |
| + |
| AppendDebugBorderQuad( |
| render_pass, content_bounds(), shared_quad_state, append_quads_data); |
| - gfx::Rect quad_rect(content_bounds()); |
| + gfx::Rect quad_rect(1, 1); |
| gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); |
| gfx::Rect visible_rect = frame_->visible_rect(); |
| gfx::Size coded_size = frame_->coded_size(); |
| - gfx::Rect visible_quad_rect = occlusion_tracker.UnoccludedContentRect( |
| - quad_rect, draw_properties().target_space_transform); |
| + gfx::Rect visible_quad_rect = |
| + occlusion_tracker.UnoccludedContentRect(quad_rect, transform); |
| if (visible_quad_rect.IsEmpty()) |
| return; |