OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layers/video_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 VideoLayerImpl::VideoLayerImpl( | 46 VideoLayerImpl::VideoLayerImpl( |
47 LayerTreeImpl* tree_impl, | 47 LayerTreeImpl* tree_impl, |
48 int id, | 48 int id, |
49 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl, | 49 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl, |
50 media::VideoRotation video_rotation) | 50 media::VideoRotation video_rotation) |
51 : LayerImpl(tree_impl, id), | 51 : LayerImpl(tree_impl, id), |
52 provider_client_impl_(std::move(provider_client_impl)), | 52 provider_client_impl_(std::move(provider_client_impl)), |
53 frame_(nullptr), | 53 frame_(nullptr), |
54 video_rotation_(video_rotation) {} | 54 video_rotation_(video_rotation) { |
| 55 set_may_contain_video(true); |
| 56 } |
55 | 57 |
56 VideoLayerImpl::~VideoLayerImpl() { | 58 VideoLayerImpl::~VideoLayerImpl() { |
57 if (!provider_client_impl_->Stopped()) { | 59 if (!provider_client_impl_->Stopped()) { |
58 // In impl side painting, we may have a pending and active layer | 60 // In impl side painting, we may have a pending and active layer |
59 // associated with the video provider at the same time. Both have a ref | 61 // associated with the video provider at the same time. Both have a ref |
60 // on the VideoFrameProviderClientImpl, but we stop when the first | 62 // on the VideoFrameProviderClientImpl, but we stop when the first |
61 // LayerImpl (the one on the pending tree) is destroyed since we know | 63 // LayerImpl (the one on the pending tree) is destroyed since we know |
62 // the main thread is blocked for this commit. | 64 // the main thread is blocked for this commit. |
63 DCHECK(layer_tree_impl()->task_runner_provider()->IsImplThread()); | 65 DCHECK(layer_tree_impl()->task_runner_provider()->IsImplThread()); |
64 DCHECK(layer_tree_impl()->task_runner_provider()->IsMainThreadBlocked()); | 66 DCHECK(layer_tree_impl()->task_runner_provider()->IsMainThreadBlocked()); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 void VideoLayerImpl::SetNeedsRedraw() { | 399 void VideoLayerImpl::SetNeedsRedraw() { |
398 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 400 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
399 layer_tree_impl()->SetNeedsRedraw(); | 401 layer_tree_impl()->SetNeedsRedraw(); |
400 } | 402 } |
401 | 403 |
402 const char* VideoLayerImpl::LayerTypeAsString() const { | 404 const char* VideoLayerImpl::LayerTypeAsString() const { |
403 return "cc::VideoLayerImpl"; | 405 return "cc::VideoLayerImpl"; |
404 } | 406 } |
405 | 407 |
406 } // namespace cc | 408 } // namespace cc |
OLD | NEW |