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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 out_data.device_scale_factor = device_scale_factor; | 86 out_data.device_scale_factor = device_scale_factor; |
87 // Move the render passes and resources into the |out_frame|. | 87 // Move the render passes and resources into the |out_frame|. |
88 out_data.render_pass_list.swap(*render_passes_in_draw_order); | 88 out_data.render_pass_list.swap(*render_passes_in_draw_order); |
89 | 89 |
90 // Collect all resource ids in the render passes into a ResourceIdArray. | 90 // Collect all resource ids in the render passes into a ResourceIdArray. |
91 ResourceProvider::ResourceIdArray resources; | 91 ResourceProvider::ResourceIdArray resources; |
92 DrawQuad::ResourceIteratorCallback append_to_array = | 92 DrawQuad::ResourceIteratorCallback append_to_array = |
93 base::Bind(&AppendToArray, &resources); | 93 base::Bind(&AppendToArray, &resources); |
94 for (size_t i = 0; i < out_data.render_pass_list.size(); ++i) { | 94 for (size_t i = 0; i < out_data.render_pass_list.size(); ++i) { |
95 RenderPass* render_pass = out_data.render_pass_list.at(i); | 95 RenderPass* render_pass = out_data.render_pass_list.at(i); |
96 for (size_t j = 0; j < render_pass->quad_list.size(); ++j) | 96 for (QuadList::Iterator iter = render_pass->quad_list.begin(); |
97 render_pass->quad_list[j]->IterateResources(append_to_array); | 97 iter != render_pass->quad_list.end(); |
| 98 ++iter) { |
| 99 iter->IterateResources(append_to_array); |
| 100 } |
98 } | 101 } |
99 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); | 102 resource_provider_->PrepareSendToParent(resources, &out_data.resource_list); |
100 } | 103 } |
101 | 104 |
102 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { | 105 void DelegatingRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { |
103 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); | 106 TRACE_EVENT0("cc,benchmark", "DelegatingRenderer::SwapBuffers"); |
104 CompositorFrame compositor_frame; | 107 CompositorFrame compositor_frame; |
105 compositor_frame.metadata = metadata; | 108 compositor_frame.metadata = metadata; |
106 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); | 109 compositor_frame.delegated_frame_data = delegated_frame_data_.Pass(); |
107 output_surface_->SwapBuffers(&compositor_frame); | 110 output_surface_->SwapBuffers(&compositor_frame); |
(...skipping 15 matching lines...) Expand all Loading... |
123 } | 126 } |
124 } | 127 } |
125 // We loop visibility to the GPU process, since that's what manages memory. | 128 // We loop visibility to the GPU process, since that's what manages memory. |
126 // That will allow it to feed us with memory allocations that we can act | 129 // That will allow it to feed us with memory allocations that we can act |
127 // upon. | 130 // upon. |
128 if (context_provider) | 131 if (context_provider) |
129 context_provider->ContextSupport()->SetSurfaceVisible(visible()); | 132 context_provider->ContextSupport()->SetSurfaceVisible(visible()); |
130 } | 133 } |
131 | 134 |
132 } // namespace cc | 135 } // namespace cc |
OLD | NEW |