| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "cc/layers/quad_sink.h" | 9 #include "cc/layers/quad_sink.h" |
| 10 #include "cc/layers/video_frame_provider_client_impl.h" | 10 #include "cc/layers/video_frame_provider_client_impl.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Drop any resources used by the updater if there is no frame to display. | 86 // Drop any resources used by the updater if there is no frame to display. |
| 87 updater_.reset(); | 87 updater_.reset(); |
| 88 | 88 |
| 89 provider_client_impl_->ReleaseLock(); | 89 provider_client_impl_->ReleaseLock(); |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 if (!LayerImpl::WillDraw(draw_mode, resource_provider)) | 93 if (!LayerImpl::WillDraw(draw_mode, resource_provider)) |
| 94 return false; | 94 return false; |
| 95 | 95 |
| 96 if (!updater_) | 96 if (!updater_) { |
| 97 updater_.reset(new VideoResourceUpdater(resource_provider)); | 97 updater_.reset( |
| 98 new VideoResourceUpdater(layer_tree_impl()->context_provider(), |
| 99 layer_tree_impl()->resource_provider())); |
| 100 } |
| 98 | 101 |
| 99 VideoFrameExternalResources external_resources = | 102 VideoFrameExternalResources external_resources = |
| 100 updater_->CreateExternalResourcesFromVideoFrame(frame_); | 103 updater_->CreateExternalResourcesFromVideoFrame(frame_); |
| 101 frame_resource_type_ = external_resources.type; | 104 frame_resource_type_ = external_resources.type; |
| 102 | 105 |
| 103 if (external_resources.type == | 106 if (external_resources.type == |
| 104 VideoFrameExternalResources::SOFTWARE_RESOURCE) { | 107 VideoFrameExternalResources::SOFTWARE_RESOURCE) { |
| 105 software_resources_ = external_resources.software_resources; | 108 software_resources_ = external_resources.software_resources; |
| 106 software_release_callback_ = | 109 software_release_callback_ = |
| 107 external_resources.software_release_callback; | 110 external_resources.software_release_callback; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void VideoLayerImpl::SetProviderClientImpl( | 305 void VideoLayerImpl::SetProviderClientImpl( |
| 303 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 306 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
| 304 provider_client_impl_ = provider_client_impl; | 307 provider_client_impl_ = provider_client_impl; |
| 305 } | 308 } |
| 306 | 309 |
| 307 const char* VideoLayerImpl::LayerTypeAsString() const { | 310 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 308 return "cc::VideoLayerImpl"; | 311 return "cc::VideoLayerImpl"; |
| 309 } | 312 } |
| 310 | 313 |
| 311 } // namespace cc | 314 } // namespace cc |
| OLD | NEW |