| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (!resource_provider_) | 150 if (!resource_provider_) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 base::hash_map<RenderPassId, gfx::Size> render_passes_in_frame; | 153 base::hash_map<RenderPassId, gfx::Size> render_passes_in_frame; |
| 154 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i) | 154 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i) |
| 155 render_passes_in_frame.insert(std::pair<RenderPassId, gfx::Size>( | 155 render_passes_in_frame.insert(std::pair<RenderPassId, gfx::Size>( |
| 156 render_passes_in_draw_order[i]->id, | 156 render_passes_in_draw_order[i]->id, |
| 157 RenderPassTextureSize(render_passes_in_draw_order[i]))); | 157 RenderPassTextureSize(render_passes_in_draw_order[i]))); |
| 158 | 158 |
| 159 std::vector<RenderPassId> passes_to_delete; | 159 std::vector<RenderPassId> passes_to_delete; |
| 160 base::ScopedPtrHashMap<RenderPassId, ScopedResource>::const_iterator | 160 base::ScopedPtrHashMap<RenderPassId, scoped_ptr<ScopedResource>>::const_iterat
or |
| 161 pass_iter; | 161 pass_iter; |
| 162 for (pass_iter = render_pass_textures_.begin(); | 162 for (pass_iter = render_pass_textures_.begin(); |
| 163 pass_iter != render_pass_textures_.end(); | 163 pass_iter != render_pass_textures_.end(); |
| 164 ++pass_iter) { | 164 ++pass_iter) { |
| 165 base::hash_map<RenderPassId, gfx::Size>::const_iterator it = | 165 base::hash_map<RenderPassId, gfx::Size>::const_iterator it = |
| 166 render_passes_in_frame.find(pass_iter->first); | 166 render_passes_in_frame.find(pass_iter->first); |
| 167 if (it == render_passes_in_frame.end()) { | 167 if (it == render_passes_in_frame.end()) { |
| 168 passes_to_delete.push_back(pass_iter->first); | 168 passes_to_delete.push_back(pass_iter->first); |
| 169 continue; | 169 continue; |
| 170 } | 170 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 ScopedResource* texture = render_pass_textures_.get(id); | 520 ScopedResource* texture = render_pass_textures_.get(id); |
| 521 return texture && texture->id(); | 521 return texture && texture->id(); |
| 522 } | 522 } |
| 523 | 523 |
| 524 // static | 524 // static |
| 525 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 525 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 526 return render_pass->output_rect.size(); | 526 return render_pass->output_rect.size(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 } // namespace cc | 529 } // namespace cc |
| OLD | NEW |