| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 454 |
| 455 if (last_sorting_context_id != quad.shared_quad_state->sorting_context_id) { | 455 if (last_sorting_context_id != quad.shared_quad_state->sorting_context_id) { |
| 456 last_sorting_context_id = quad.shared_quad_state->sorting_context_id; | 456 last_sorting_context_id = quad.shared_quad_state->sorting_context_id; |
| 457 FlushPolygons(&poly_list, frame, render_pass_scissor_in_draw_space, | 457 FlushPolygons(&poly_list, frame, render_pass_scissor_in_draw_space, |
| 458 render_pass_is_clipped); | 458 render_pass_is_clipped); |
| 459 } | 459 } |
| 460 | 460 |
| 461 // This layer is in a 3D sorting context so we add it to the list of | 461 // This layer is in a 3D sorting context so we add it to the list of |
| 462 // polygons to go into the BSP tree. | 462 // polygons to go into the BSP tree. |
| 463 if (quad.shared_quad_state->sorting_context_id != 0) { | 463 if (quad.shared_quad_state->sorting_context_id != 0) { |
| 464 scoped_ptr<DrawPolygon> new_polygon( | 464 scoped_ptr<DrawPolygon> new_polygon(new DrawPolygon( |
| 465 new DrawPolygon(*it, quad.visible_rect, | 465 *it, quad.visible_rect, |
| 466 quad.shared_quad_state->content_to_target_transform, | 466 quad.shared_quad_state->quad_to_target_transform, next_polygon_id++)); |
| 467 next_polygon_id++)); | |
| 468 if (new_polygon->points().size() > 2u) { | 467 if (new_polygon->points().size() > 2u) { |
| 469 poly_list.push_back(new_polygon.Pass()); | 468 poly_list.push_back(new_polygon.Pass()); |
| 470 } | 469 } |
| 471 continue; | 470 continue; |
| 472 } | 471 } |
| 473 | 472 |
| 474 // We are not in a 3d sorting context, so we should draw the quad normally. | 473 // We are not in a 3d sorting context, so we should draw the quad normally. |
| 475 SetScissorStateForQuad(frame, quad, render_pass_scissor_in_draw_space, | 474 SetScissorStateForQuad(frame, quad, render_pass_scissor_in_draw_space, |
| 476 render_pass_is_clipped); | 475 render_pass_is_clipped); |
| 477 | 476 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 ScopedResource* texture = render_pass_textures_.get(id); | 520 ScopedResource* texture = render_pass_textures_.get(id); |
| 522 return texture && texture->id(); | 521 return texture && texture->id(); |
| 523 } | 522 } |
| 524 | 523 |
| 525 // static | 524 // static |
| 526 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 525 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 527 return render_pass->output_rect.size(); | 526 return render_pass->output_rect.size(); |
| 528 } | 527 } |
| 529 | 528 |
| 530 } // namespace cc | 529 } // namespace cc |
| OLD | NEW |