| 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 float device_scale_factor, | 86 float device_scale_factor, |
| 87 const gfx::Rect& device_viewport_rect, | 87 const gfx::Rect& device_viewport_rect, |
| 88 const gfx::Rect& device_clip_rect, | 88 const gfx::Rect& device_clip_rect, |
| 89 bool disable_picture_quad_image_filtering) { | 89 bool disable_picture_quad_image_filtering) { |
| 90 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); | 90 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); |
| 91 | 91 |
| 92 DCHECK(!delegated_frame_data_); | 92 DCHECK(!delegated_frame_data_); |
| 93 | 93 |
| 94 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); | 94 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); |
| 95 DelegatedFrameData& out_data = *delegated_frame_data_; | 95 DelegatedFrameData& out_data = *delegated_frame_data_; |
| 96 out_data.device_scale_factor = device_scale_factor; | |
| 97 // Move the render passes and resources into the |out_frame|. | 96 // Move the render passes and resources into the |out_frame|. |
| 98 out_data.render_pass_list.swap(*render_passes_in_draw_order); | 97 out_data.render_pass_list.swap(*render_passes_in_draw_order); |
| 99 | 98 |
| 100 // Collect all resource ids in the render passes into a ResourceIdArray. | 99 // Collect all resource ids in the render passes into a ResourceIdArray. |
| 101 ResourceProvider::ResourceIdArray resources; | 100 ResourceProvider::ResourceIdArray resources; |
| 102 DrawQuad::ResourceIteratorCallback append_to_array = | 101 DrawQuad::ResourceIteratorCallback append_to_array = |
| 103 base::Bind(&AppendToArray, &resources); | 102 base::Bind(&AppendToArray, &resources); |
| 104 for (size_t i = 0; i < out_data.render_pass_list.size(); ++i) { | 103 for (size_t i = 0; i < out_data.render_pass_list.size(); ++i) { |
| 105 RenderPass* render_pass = out_data.render_pass_list.at(i); | 104 RenderPass* render_pass = out_data.render_pass_list.at(i); |
| 106 for (size_t j = 0; j < render_pass->quad_list.size(); ++j) | 105 for (size_t j = 0; j < render_pass->quad_list.size(); ++j) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 gpu::ManagedMemoryStats stats; | 157 gpu::ManagedMemoryStats stats; |
| 159 stats.bytes_required = bytes_visible; | 158 stats.bytes_required = bytes_visible; |
| 160 stats.bytes_nice_to_have = bytes_visible_and_nearby; | 159 stats.bytes_nice_to_have = bytes_visible_and_nearby; |
| 161 stats.bytes_allocated = bytes_allocated; | 160 stats.bytes_allocated = bytes_allocated; |
| 162 stats.backbuffer_requested = false; | 161 stats.backbuffer_requested = false; |
| 163 | 162 |
| 164 context_provider->ContextSupport()->SendManagedMemoryStats(stats); | 163 context_provider->ContextSupport()->SendManagedMemoryStats(stats); |
| 165 } | 164 } |
| 166 | 165 |
| 167 } // namespace cc | 166 } // namespace cc |
| OLD | NEW |