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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
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 | 13 |
13 namespace cc { | 14 namespace cc { |
14 | 15 |
15 void BspWalkActionToVector::operator()(DrawPolygon* item) { | 16 BspWalkActionDrawPolygon::BspWalkActionDrawPolygon( |
16 list_->push_back(item); | 17 DirectRenderer* renderer, |
18 DirectRenderer::DrawingFrame* frame, | |
19 const gfx::Rect& render_pass_scissor, | |
20 bool using_scissor_as_optimization) | |
21 : renderer_(renderer), | |
22 frame_(frame), | |
23 render_pass_scissor_(render_pass_scissor), | |
24 using_scissor_as_optimization_(using_scissor_as_optimization) { | |
25 } | |
26 | |
27 void BspWalkActionDrawPolygon::operator()(DrawPolygon* item) { | |
28 gfx::Transform inverse_transform; | |
29 bool b = item->original_ref()->quadTransform().GetInverse(&inverse_transform); | |
enne (OOO)
2015/02/12 18:00:26
naming nit: b => invertible?
awoloszyn
2015/02/23 22:28:25
Done.
| |
30 DCHECK(b); | |
31 item->TransformToLayerSpace(inverse_transform); | |
32 renderer_->DoDrawPolygon(*item, frame_, render_pass_scissor_, | |
33 using_scissor_as_optimization_); | |
17 } | 34 } |
18 | 35 |
19 BspWalkActionToVector::BspWalkActionToVector(std::vector<DrawPolygon*>* in_list) | 36 BspWalkActionToVector::BspWalkActionToVector(std::vector<DrawPolygon*>* in_list) |
20 : list_(in_list) { | 37 : list_(in_list) { |
21 } | 38 } |
22 | 39 |
40 void BspWalkActionToVector::operator()(DrawPolygon* item) { | |
41 list_->push_back(item); | |
42 } | |
43 | |
23 } // namespace cc | 44 } // namespace cc |
OLD | NEW |