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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 frame_resource_type_ = external_resources.type; | 104 frame_resource_type_ = external_resources.type; |
105 | 105 |
106 if (external_resources.type == | 106 if (external_resources.type == |
107 VideoFrameExternalResources::SOFTWARE_RESOURCE) { | 107 VideoFrameExternalResources::SOFTWARE_RESOURCE) { |
108 software_resources_ = external_resources.software_resources; | 108 software_resources_ = external_resources.software_resources; |
109 software_release_callback_ = | 109 software_release_callback_ = |
110 external_resources.software_release_callback; | 110 external_resources.software_release_callback; |
111 return true; | 111 return true; |
112 } | 112 } |
113 | 113 |
| 114 DCHECK_EQ(external_resources.mailboxes.size(), |
| 115 external_resources.release_callbacks.size()); |
114 for (size_t i = 0; i < external_resources.mailboxes.size(); ++i) { | 116 for (size_t i = 0; i < external_resources.mailboxes.size(); ++i) { |
115 frame_resources_.push_back( | 117 unsigned resource_id = resource_provider->CreateResourceFromTextureMailbox( |
116 resource_provider->CreateResourceFromTextureMailbox( | 118 external_resources.mailboxes[i], |
117 external_resources.mailboxes[i])); | 119 ScopedReleaseCallback(external_resources.release_callbacks[i])); |
| 120 frame_resources_.push_back(resource_id); |
118 } | 121 } |
119 | 122 |
120 return true; | 123 return true; |
121 } | 124 } |
122 | 125 |
123 void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, | 126 void VideoLayerImpl::AppendQuads(QuadSink* quad_sink, |
124 AppendQuadsData* append_quads_data) { | 127 AppendQuadsData* append_quads_data) { |
125 DCHECK(frame_.get()); | 128 DCHECK(frame_.get()); |
126 | 129 |
127 SharedQuadState* shared_quad_state = | 130 SharedQuadState* shared_quad_state = |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void VideoLayerImpl::SetProviderClientImpl( | 308 void VideoLayerImpl::SetProviderClientImpl( |
306 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 309 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
307 provider_client_impl_ = provider_client_impl; | 310 provider_client_impl_ = provider_client_impl; |
308 } | 311 } |
309 | 312 |
310 const char* VideoLayerImpl::LayerTypeAsString() const { | 313 const char* VideoLayerImpl::LayerTypeAsString() const { |
311 return "cc::VideoLayerImpl"; | 314 return "cc::VideoLayerImpl"; |
312 } | 315 } |
313 | 316 |
314 } // namespace cc | 317 } // namespace cc |
OLD | NEW |