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_RENDER_PASS_TEST_UTILS_H_
6 #define CC_TEST_RENDER_PASS_TEST_UTILS_H_
8 #include "cc/base/scoped_ptr_vector.h"
9 #include "cc/output/filter_operations.h"
10 #include "cc/quads/render_pass.h"
11 #include "cc/resources/resource_provider.h"
12 #include "third_party/skia/include/core/SkColor.h"
21 class SolidColorDrawQuad
;
24 // Adds a new render pass with the provided properties to the given
26 RenderPass
* AddRenderPass(RenderPassList
* pass_list
,
28 const gfx::Rect
& output_rect
,
29 const gfx::Transform
& root_transform
);
31 // Adds a solid quad to a given render pass.
32 SolidColorDrawQuad
* AddQuad(RenderPass
* pass
,
33 const gfx::Rect
& rect
,
36 // Adds a solid quad to a given render pass and sets is_clipped=true.
37 SolidColorDrawQuad
* AddClippedQuad(RenderPass
* pass
,
38 const gfx::Rect
& rect
,
41 // Adds a solid quad with a transform to a given render pass.
42 SolidColorDrawQuad
* AddTransformedQuad(RenderPass
* pass
,
43 const gfx::Rect
& rect
,
45 const gfx::Transform
& transform
);
47 // Adds a render pass quad to an existing render pass.
48 void AddRenderPassQuad(RenderPass
* to_pass
, RenderPass
* contributing_pass
);
50 // Adds a render pass quad with the given mask resource, filter, and transform.
51 void AddRenderPassQuad(RenderPass
* to_pass
,
52 RenderPass
* contributing_pass
,
53 ResourceId mask_resource_id
,
54 const FilterOperations
& filters
,
55 gfx::Transform transform
,
56 SkXfermode::Mode blend_mode
);
58 void AddOneOfEveryQuadType(RenderPass
* to_pass
,
59 ResourceProvider
* resource_provider
,
60 RenderPassId child_pass
,
61 uint32_t* sync_point_for_mailbox_texture_quad
);
65 #endif // CC_TEST_RENDER_PASS_TEST_UTILS_H_