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
3 // found in the LICENSE file.
5 #ifndef CC_TEST_MOCK_QUAD_CULLER_H_
6 #define CC_TEST_MOCK_QUAD_CULLER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/layers/quad_sink.h"
10 #include "cc/quads/draw_quad.h"
11 #include "cc/quads/render_pass.h"
15 class MockQuadCuller
: public QuadSink
{
18 virtual ~MockQuadCuller();
20 explicit MockQuadCuller(RenderPass
* external_render_pass
);
22 // QuadSink interface.
23 virtual SharedQuadState
* CreateSharedQuadState() OVERRIDE
;
24 virtual gfx::Rect
UnoccludedContentRect(const gfx::Rect
& content_rect
,
25 const gfx::Transform
& draw_transform
)
27 virtual gfx::Rect
UnoccludedContributingSurfaceContentRect(
28 const gfx::Rect
& content_rect
,
29 const gfx::Transform
& draw_transform
) OVERRIDE
;
30 virtual void Append(scoped_ptr
<DrawQuad
> draw_quad
) OVERRIDE
;
32 const QuadList
& quad_list() const { return active_render_pass_
->quad_list
; }
33 const SharedQuadStateList
& shared_quad_state_list() const {
34 return active_render_pass_
->shared_quad_state_list
;
37 void set_occluded_target_rect(const gfx::Rect
& occluded
) {
38 occluded_target_rect_
= occluded
;
41 void set_occluded_target_rect_for_contributing_surface(
42 const gfx::Rect
& occluded
) {
43 occluded_target_rect_for_contributing_surface_
= occluded
;
47 active_render_pass_
->quad_list
.clear();
48 active_render_pass_
->shared_quad_state_list
.clear();
52 scoped_ptr
<RenderPass
> render_pass_storage_
;
53 RenderPass
* active_render_pass_
;
54 gfx::Rect occluded_target_rect_
;
55 gfx::Rect occluded_target_rect_for_contributing_surface_
;
60 #endif // CC_TEST_MOCK_QUAD_CULLER_H_