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/direct_renderer.h" | 5 #include "cc/output/direct_renderer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 ResourceProvider* resource_provider) | 132 ResourceProvider* resource_provider) |
133 : Renderer(client, settings), | 133 : Renderer(client, settings), |
134 output_surface_(output_surface), | 134 output_surface_(output_surface), |
135 resource_provider_(resource_provider) {} | 135 resource_provider_(resource_provider) {} |
136 | 136 |
137 DirectRenderer::~DirectRenderer() {} | 137 DirectRenderer::~DirectRenderer() {} |
138 | 138 |
139 bool DirectRenderer::CanReadPixels() const { return true; } | 139 bool DirectRenderer::CanReadPixels() const { return true; } |
140 | 140 |
141 void DirectRenderer::SetEnlargePassTextureAmountForTesting( | 141 void DirectRenderer::SetEnlargePassTextureAmountForTesting( |
142 gfx::Vector2d amount) { | 142 const gfx::Vector2d& amount) { |
143 enlarge_pass_texture_amount_ = amount; | 143 enlarge_pass_texture_amount_ = amount; |
144 } | 144 } |
145 | 145 |
146 void DirectRenderer::DecideRenderPassAllocationsForFrame( | 146 void DirectRenderer::DecideRenderPassAllocationsForFrame( |
147 const RenderPassList& render_passes_in_draw_order) { | 147 const RenderPassList& render_passes_in_draw_order) { |
148 if (!resource_provider_) | 148 if (!resource_provider_) |
149 return; | 149 return; |
150 | 150 |
151 base::hash_map<RenderPass::Id, gfx::Size> render_passes_in_frame; | 151 base::hash_map<RenderPass::Id, gfx::Size> render_passes_in_frame; |
152 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i) | 152 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i) |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 ScopedResource* texture = render_pass_textures_.get(id); | 421 ScopedResource* texture = render_pass_textures_.get(id); |
422 return texture && texture->id(); | 422 return texture && texture->id(); |
423 } | 423 } |
424 | 424 |
425 // static | 425 // static |
426 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 426 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
427 return render_pass->output_rect.size(); | 427 return render_pass->output_rect.size(); |
428 } | 428 } |
429 | 429 |
430 } // namespace cc | 430 } // namespace cc |
OLD | NEW |