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
3 // found in the LICENSE file.
5 #include "cc/output/bsp_walk_action.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/output/direct_renderer.h"
11 #include "cc/quads/draw_polygon.h"
12 #include "cc/quads/draw_quad.h"
16 BspWalkActionDrawPolygon::BspWalkActionDrawPolygon(
17 DirectRenderer
* renderer
,
18 DirectRenderer::DrawingFrame
* frame
,
19 const gfx::Rect
& render_pass_scissor
,
20 bool using_scissor_as_optimization
)
21 : renderer_(renderer
),
23 render_pass_scissor_(render_pass_scissor
),
24 using_scissor_as_optimization_(using_scissor_as_optimization
) {
27 void BspWalkActionDrawPolygon::operator()(DrawPolygon
* item
) {
28 gfx::Transform inverse_transform
;
31 ->shared_quad_state
->quad_to_target_transform
.GetInverse(
34 item
->TransformToLayerSpace(inverse_transform
);
35 renderer_
->DoDrawPolygon(*item
, frame_
, render_pass_scissor_
,
36 using_scissor_as_optimization_
);
39 BspWalkActionToVector::BspWalkActionToVector(std::vector
<DrawPolygon
*>* in_list
)
43 void BspWalkActionToVector::operator()(DrawPolygon
* item
) {
44 list_
->push_back(item
);