| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 return; | 378 return; |
| 379 } | 379 } |
| 380 | 380 |
| 381 std::vector<gfx::QuadF> quads; | 381 std::vector<gfx::QuadF> quads; |
| 382 poly.ToQuads2D(&quads); | 382 poly.ToQuads2D(&quads); |
| 383 for (size_t i = 0; i < quads.size(); ++i) { | 383 for (size_t i = 0; i < quads.size(); ++i) { |
| 384 DoDrawQuad(frame, poly.original_ref(), &quads[i]); | 384 DoDrawQuad(frame, poly.original_ref(), &quads[i]); |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 void DirectRenderer::FlushPolygons(ScopedPtrDeque<DrawPolygon>* poly_list, | 388 void DirectRenderer::FlushPolygons( |
| 389 DrawingFrame* frame, | 389 std::deque<scoped_ptr<DrawPolygon>>* poly_list, |
| 390 const gfx::Rect& render_pass_scissor, | 390 DrawingFrame* frame, |
| 391 bool use_render_pass_scissor) { | 391 const gfx::Rect& render_pass_scissor, |
| 392 bool use_render_pass_scissor) { |
| 392 if (poly_list->empty()) { | 393 if (poly_list->empty()) { |
| 393 return; | 394 return; |
| 394 } | 395 } |
| 395 | 396 |
| 396 BspTree bsp_tree(poly_list); | 397 BspTree bsp_tree(poly_list); |
| 397 BspWalkActionDrawPolygon action_handler(this, frame, render_pass_scissor, | 398 BspWalkActionDrawPolygon action_handler(this, frame, render_pass_scissor, |
| 398 use_render_pass_scissor); | 399 use_render_pass_scissor); |
| 399 bsp_tree.TraverseWithActionHandler(&action_handler); | 400 bsp_tree.TraverseWithActionHandler(&action_handler); |
| 400 DCHECK(poly_list->empty()); | 401 DCHECK(poly_list->empty()); |
| 401 } | 402 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; | 448 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; |
| 448 } else { | 449 } else { |
| 449 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; | 450 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; |
| 450 } | 451 } |
| 451 | 452 |
| 452 PrepareSurfaceForPass( | 453 PrepareSurfaceForPass( |
| 453 frame, mode, | 454 frame, mode, |
| 454 MoveFromDrawToWindowSpace(frame, render_pass_scissor_in_draw_space)); | 455 MoveFromDrawToWindowSpace(frame, render_pass_scissor_in_draw_space)); |
| 455 | 456 |
| 456 const QuadList& quad_list = render_pass->quad_list; | 457 const QuadList& quad_list = render_pass->quad_list; |
| 457 ScopedPtrDeque<DrawPolygon> poly_list; | 458 std::deque<scoped_ptr<DrawPolygon>> poly_list; |
| 458 | 459 |
| 459 int next_polygon_id = 0; | 460 int next_polygon_id = 0; |
| 460 int last_sorting_context_id = 0; | 461 int last_sorting_context_id = 0; |
| 461 for (auto it = quad_list.BackToFrontBegin(); it != quad_list.BackToFrontEnd(); | 462 for (auto it = quad_list.BackToFrontBegin(); it != quad_list.BackToFrontEnd(); |
| 462 ++it) { | 463 ++it) { |
| 463 const DrawQuad& quad = **it; | 464 const DrawQuad& quad = **it; |
| 464 gfx::QuadF send_quad(gfx::RectF(quad.visible_rect)); | 465 gfx::QuadF send_quad(gfx::RectF(quad.visible_rect)); |
| 465 | 466 |
| 466 if (render_pass_is_clipped && | 467 if (render_pass_is_clipped && |
| 467 ShouldSkipQuad(quad, render_pass_scissor_in_draw_space)) { | 468 ShouldSkipQuad(quad, render_pass_scissor_in_draw_space)) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 ScopedResource* texture = render_pass_textures_.get(id); | 538 ScopedResource* texture = render_pass_textures_.get(id); |
| 538 return texture && texture->id(); | 539 return texture && texture->id(); |
| 539 } | 540 } |
| 540 | 541 |
| 541 // static | 542 // static |
| 542 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 543 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 543 return render_pass->output_rect.size(); | 544 return render_pass->output_rect.size(); |
| 544 } | 545 } |
| 545 | 546 |
| 546 } // namespace cc | 547 } // namespace cc |
| OLD | NEW |