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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 return; | 397 return; |
398 } | 398 } |
399 | 399 |
400 std::vector<gfx::QuadF> quads; | 400 std::vector<gfx::QuadF> quads; |
401 poly.ToQuads2D(&quads); | 401 poly.ToQuads2D(&quads); |
402 for (size_t i = 0; i < quads.size(); ++i) { | 402 for (size_t i = 0; i < quads.size(); ++i) { |
403 DoDrawQuad(frame, poly.original_ref(), &quads[i]); | 403 DoDrawQuad(frame, poly.original_ref(), &quads[i]); |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 void DirectRenderer::FlushPolygons(ScopedPtrDeque<DrawPolygon>* poly_list, | 407 void DirectRenderer::FlushPolygons( |
408 DrawingFrame* frame, | 408 std::deque<scoped_ptr<DrawPolygon>>* poly_list, |
409 const gfx::Rect& render_pass_scissor, | 409 DrawingFrame* frame, |
410 bool use_render_pass_scissor) { | 410 const gfx::Rect& render_pass_scissor, |
| 411 bool use_render_pass_scissor) { |
411 if (poly_list->empty()) { | 412 if (poly_list->empty()) { |
412 return; | 413 return; |
413 } | 414 } |
414 | 415 |
415 BspTree bsp_tree(poly_list); | 416 BspTree bsp_tree(poly_list); |
416 BspWalkActionDrawPolygon action_handler(this, frame, render_pass_scissor, | 417 BspWalkActionDrawPolygon action_handler(this, frame, render_pass_scissor, |
417 use_render_pass_scissor); | 418 use_render_pass_scissor); |
418 bsp_tree.TraverseWithActionHandler(&action_handler); | 419 bsp_tree.TraverseWithActionHandler(&action_handler); |
419 DCHECK(poly_list->empty()); | 420 DCHECK(poly_list->empty()); |
420 } | 421 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; | 467 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; |
467 } else { | 468 } else { |
468 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; | 469 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; |
469 } | 470 } |
470 | 471 |
471 PrepareSurfaceForPass( | 472 PrepareSurfaceForPass( |
472 frame, mode, | 473 frame, mode, |
473 MoveFromDrawToWindowSpace(frame, render_pass_scissor_in_draw_space)); | 474 MoveFromDrawToWindowSpace(frame, render_pass_scissor_in_draw_space)); |
474 | 475 |
475 const QuadList& quad_list = render_pass->quad_list; | 476 const QuadList& quad_list = render_pass->quad_list; |
476 ScopedPtrDeque<DrawPolygon> poly_list; | 477 std::deque<scoped_ptr<DrawPolygon>> poly_list; |
477 | 478 |
478 int next_polygon_id = 0; | 479 int next_polygon_id = 0; |
479 int last_sorting_context_id = 0; | 480 int last_sorting_context_id = 0; |
480 for (auto it = quad_list.BackToFrontBegin(); it != quad_list.BackToFrontEnd(); | 481 for (auto it = quad_list.BackToFrontBegin(); it != quad_list.BackToFrontEnd(); |
481 ++it) { | 482 ++it) { |
482 const DrawQuad& quad = **it; | 483 const DrawQuad& quad = **it; |
483 gfx::QuadF send_quad(gfx::RectF(quad.visible_rect)); | 484 gfx::QuadF send_quad(gfx::RectF(quad.visible_rect)); |
484 | 485 |
485 if (render_pass_is_clipped && | 486 if (render_pass_is_clipped && |
486 ShouldSkipQuad(quad, render_pass_scissor_in_draw_space)) { | 487 ShouldSkipQuad(quad, render_pass_scissor_in_draw_space)) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 ScopedResource* texture = render_pass_textures_.get(id); | 557 ScopedResource* texture = render_pass_textures_.get(id); |
557 return texture && texture->id(); | 558 return texture && texture->id(); |
558 } | 559 } |
559 | 560 |
560 // static | 561 // static |
561 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 562 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
562 return render_pass->output_rect.size(); | 563 return render_pass->output_rect.size(); |
563 } | 564 } |
564 | 565 |
565 } // namespace cc | 566 } // namespace cc |
OLD | NEW |