OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/output/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 DCHECK(!delegated_frame_data_); | 82 DCHECK(!delegated_frame_data_); |
83 | 83 |
84 delegated_frame_data_ = base::WrapUnique(new DelegatedFrameData); | 84 delegated_frame_data_ = base::WrapUnique(new DelegatedFrameData); |
85 DelegatedFrameData& out_data = *delegated_frame_data_; | 85 DelegatedFrameData& out_data = *delegated_frame_data_; |
86 // Move the render passes and resources into the |out_frame|. | 86 // Move the render passes and resources into the |out_frame|. |
87 out_data.render_pass_list.swap(*render_passes_in_draw_order); | 87 out_data.render_pass_list.swap(*render_passes_in_draw_order); |
88 | 88 |
89 // Collect all resource ids in the render passes into a ResourceIdArray. | 89 // Collect all resource ids in the render passes into a ResourceIdArray. |
90 ResourceProvider::ResourceIdArray resources; | 90 ResourceProvider::ResourceIdArray resources; |
91 for (const auto& render_pass : out_data.render_pass_list) { | 91 for (const auto& render_pass : out_data.render_pass_list) { |
92 for (const auto& quad : render_pass->quad_list) { | 92 for (auto* quad : render_pass->quad_list) { |
93 for (ResourceId resource_id : quad->resources) | 93 for (ResourceId resource_id : quad->resources) |
94 resources.push_back(resource_id); | 94 resources.push_back(resource_id); |
95 } | 95 } |
96 } | 96 } |
97 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); | 97 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); |
98 } | 98 } |
99 | 99 |
100 void DelegatingRenderer::SwapBuffers(CompositorFrameMetadata metadata) { | 100 void DelegatingRenderer::SwapBuffers(CompositorFrameMetadata metadata) { |
101 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); | 101 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); |
102 CompositorFrame compositor_frame; | 102 CompositorFrame compositor_frame; |
(...skipping 17 matching lines...) Expand all Loading... |
120 } | 120 } |
121 } | 121 } |
122 if (context_provider) { | 122 if (context_provider) { |
123 // If we are not visible, we ask the context to aggressively free resources. | 123 // If we are not visible, we ask the context to aggressively free resources. |
124 context_provider->ContextSupport()->SetAggressivelyFreeResources( | 124 context_provider->ContextSupport()->SetAggressivelyFreeResources( |
125 !visible()); | 125 !visible()); |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 } // namespace cc | 129 } // namespace cc |
OLD | NEW |