| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bsp_walk_action.h" | 5 #include "cc/output/bsp_walk_action.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/output/direct_renderer.h" | 10 #include "cc/output/direct_renderer.h" |
| 11 #include "cc/quads/draw_polygon.h" | 11 #include "cc/quads/draw_polygon.h" |
| 12 #include "cc/quads/draw_quad.h" | 12 #include "cc/quads/draw_quad.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 BspWalkActionDrawPolygon::BspWalkActionDrawPolygon( | 16 BspWalkActionDrawPolygon::BspWalkActionDrawPolygon( |
| 17 DirectRenderer* renderer, | 17 DirectRenderer* renderer, |
| 18 DirectRenderer::DrawingFrame* frame, | |
| 19 const gfx::Rect& render_pass_scissor, | 18 const gfx::Rect& render_pass_scissor, |
| 20 bool using_scissor_as_optimization) | 19 bool using_scissor_as_optimization) |
| 21 : renderer_(renderer), | 20 : renderer_(renderer), |
| 22 frame_(frame), | |
| 23 render_pass_scissor_(render_pass_scissor), | 21 render_pass_scissor_(render_pass_scissor), |
| 24 using_scissor_as_optimization_(using_scissor_as_optimization) { | 22 using_scissor_as_optimization_(using_scissor_as_optimization) { |
| 25 } | 23 } |
| 26 | 24 |
| 27 void BspWalkActionDrawPolygon::operator()(DrawPolygon* item) { | 25 void BspWalkActionDrawPolygon::operator()(DrawPolygon* item) { |
| 28 gfx::Transform inverse_transform; | 26 gfx::Transform inverse_transform; |
| 29 bool invertible = | 27 bool invertible = |
| 30 item->original_ref() | 28 item->original_ref() |
| 31 ->shared_quad_state->quad_to_target_transform.GetInverse( | 29 ->shared_quad_state->quad_to_target_transform.GetInverse( |
| 32 &inverse_transform); | 30 &inverse_transform); |
| 33 DCHECK(invertible); | 31 DCHECK(invertible); |
| 34 item->TransformToLayerSpace(inverse_transform); | 32 item->TransformToLayerSpace(inverse_transform); |
| 35 renderer_->DoDrawPolygon(*item, frame_, render_pass_scissor_, | 33 renderer_->DoDrawPolygon(*item, render_pass_scissor_, |
| 36 using_scissor_as_optimization_); | 34 using_scissor_as_optimization_); |
| 37 } | 35 } |
| 38 | 36 |
| 39 BspWalkActionToVector::BspWalkActionToVector(std::vector<DrawPolygon*>* in_list) | 37 BspWalkActionToVector::BspWalkActionToVector(std::vector<DrawPolygon*>* in_list) |
| 40 : list_(in_list) { | 38 : list_(in_list) { |
| 41 } | 39 } |
| 42 | 40 |
| 43 void BspWalkActionToVector::operator()(DrawPolygon* item) { | 41 void BspWalkActionToVector::operator()(DrawPolygon* item) { |
| 44 list_->push_back(item); | 42 list_->push_back(item); |
| 45 } | 43 } |
| 46 | 44 |
| 47 } // namespace cc | 45 } // namespace cc |
| OLD | NEW |