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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 frame_resource_offset_ = external_resources.offset; | 120 frame_resource_offset_ = external_resources.offset; |
121 frame_resource_multiplier_ = external_resources.multiplier; | 121 frame_resource_multiplier_ = external_resources.multiplier; |
122 frame_bits_per_channel_ = external_resources.bits_per_channel; | 122 frame_bits_per_channel_ = external_resources.bits_per_channel; |
123 | 123 |
124 DCHECK_EQ(external_resources.mailboxes.size(), | 124 DCHECK_EQ(external_resources.mailboxes.size(), |
125 external_resources.release_callbacks.size()); | 125 external_resources.release_callbacks.size()); |
126 ResourceProvider::ResourceIdArray resource_ids; | 126 ResourceProvider::ResourceIdArray resource_ids; |
127 resource_ids.reserve(external_resources.mailboxes.size()); | 127 resource_ids.reserve(external_resources.mailboxes.size()); |
128 for (size_t i = 0; i < external_resources.mailboxes.size(); ++i) { | 128 for (size_t i = 0; i < external_resources.mailboxes.size(); ++i) { |
129 unsigned resource_id = resource_provider->CreateResourceFromTextureMailbox( | 129 unsigned resource_id = resource_provider->CreateResourceFromTextureMailbox( |
130 external_resources.mailboxes[i], | 130 external_resources.mailboxes[i], external_resources.format, |
131 SingleReleaseCallbackImpl::Create( | 131 SingleReleaseCallbackImpl::Create( |
132 external_resources.release_callbacks[i]), | 132 external_resources.release_callbacks[i]), |
133 external_resources.read_lock_fences_enabled); | 133 external_resources.read_lock_fences_enabled); |
134 frame_resources_.push_back(FrameResource( | 134 frame_resources_.push_back(FrameResource( |
135 resource_id, external_resources.mailboxes[i].size_in_pixels(), | 135 resource_id, external_resources.mailboxes[i].size_in_pixels(), |
136 external_resources.mailboxes[i].is_overlay_candidate())); | 136 external_resources.mailboxes[i].is_overlay_candidate())); |
137 resource_ids.push_back(resource_id); | 137 resource_ids.push_back(resource_id); |
138 } | 138 } |
139 resource_provider->GenerateSyncTokenForResources(resource_ids); | 139 resource_provider->GenerateSyncTokenForResources(resource_ids); |
140 | 140 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 void VideoLayerImpl::SetNeedsRedraw() { | 372 void VideoLayerImpl::SetNeedsRedraw() { |
373 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 373 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
374 layer_tree_impl()->SetNeedsRedraw(); | 374 layer_tree_impl()->SetNeedsRedraw(); |
375 } | 375 } |
376 | 376 |
377 const char* VideoLayerImpl::LayerTypeAsString() const { | 377 const char* VideoLayerImpl::LayerTypeAsString() const { |
378 return "cc::VideoLayerImpl"; | 378 return "cc::VideoLayerImpl"; |
379 } | 379 } |
380 | 380 |
381 } // namespace cc | 381 } // namespace cc |
OLD | NEW |