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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 float device_scale_factor, | 77 float device_scale_factor, |
78 const gfx::Rect& device_viewport_rect, | 78 const gfx::Rect& device_viewport_rect, |
79 const gfx::Rect& device_clip_rect, | 79 const gfx::Rect& device_clip_rect, |
80 bool disable_picture_quad_image_filtering) { | 80 bool disable_picture_quad_image_filtering) { |
81 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); | 81 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); |
82 | 82 |
83 DCHECK(!delegated_frame_data_); | 83 DCHECK(!delegated_frame_data_); |
84 | 84 |
85 delegated_frame_data_ = base::WrapUnique(new DelegatedFrameData); | 85 delegated_frame_data_ = base::WrapUnique(new DelegatedFrameData); |
86 DelegatedFrameData& out_data = *delegated_frame_data_; | 86 DelegatedFrameData& out_data = *delegated_frame_data_; |
87 out_data.device_scale_factor = device_scale_factor; | |
88 // Move the render passes and resources into the |out_frame|. | 87 // Move the render passes and resources into the |out_frame|. |
89 out_data.render_pass_list.swap(*render_passes_in_draw_order); | 88 out_data.render_pass_list.swap(*render_passes_in_draw_order); |
90 | 89 |
91 // Collect all resource ids in the render passes into a ResourceIdArray. | 90 // Collect all resource ids in the render passes into a ResourceIdArray. |
92 ResourceProvider::ResourceIdArray resources; | 91 ResourceProvider::ResourceIdArray resources; |
93 for (const auto& render_pass : out_data.render_pass_list) { | 92 for (const auto& render_pass : out_data.render_pass_list) { |
94 for (const auto& quad : render_pass->quad_list) { | 93 for (const auto& quad : render_pass->quad_list) { |
95 for (ResourceId resource_id : quad->resources) | 94 for (ResourceId resource_id : quad->resources) |
96 resources.push_back(resource_id); | 95 resources.push_back(resource_id); |
97 } | 96 } |
(...skipping 24 matching lines...) Expand all Loading... |
122 } | 121 } |
123 } | 122 } |
124 if (context_provider) { | 123 if (context_provider) { |
125 // If we are not visible, we ask the context to aggressively free resources. | 124 // If we are not visible, we ask the context to aggressively free resources. |
126 context_provider->ContextSupport()->SetAggressivelyFreeResources( | 125 context_provider->ContextSupport()->SetAggressivelyFreeResources( |
127 !visible()); | 126 !visible()); |
128 } | 127 } |
129 } | 128 } |
130 | 129 |
131 } // namespace cc | 130 } // namespace cc |
OLD | NEW |