Chromium Code Reviews| Index: cc/surfaces/surface_aggregator_test_helpers.h |
| diff --git a/cc/surfaces/surface_aggregator_test_helpers.h b/cc/surfaces/surface_aggregator_test_helpers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4d4ee36e1df12848d4dfd55fe9bfb2391d0f70c2 |
| --- /dev/null |
| +++ b/cc/surfaces/surface_aggregator_test_helpers.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_SURFACES_SURFACE_AGGREGATOR_TEST_HELPERS_H_ |
| +#define CC_SURFACES_SURFACE_AGGREGATOR_TEST_HELPERS_H_ |
| + |
| +#include "cc/quads/render_pass.h" |
| +#include "ui/gfx/size.h" |
| + |
| +namespace cc { |
| + |
| +class Surface; |
| +class TestRenderPass; |
| + |
| +namespace test { |
| + |
| +struct Quad { |
| + Quad(char type, int data) : type(type), data(data), size(gfx::Size(5, 5)) {} |
| + |
| + Quad(char type, int data, const gfx::Size& size) |
| + : type(type), data(data), size(size) {} |
| + |
| + char type; |
| + int data; // surface_id for type=='S', color for type=='C' |
|
jamesr
2014/01/22 23:06:02
turns out this is too simple for anything useful,
|
| + gfx::Size size; |
| +}; |
| + |
| +struct Pass { |
| + Pass(Quad* quads, size_t quad_count) : quads(quads), quad_count(quad_count) {} |
| + |
| + Quad* quads; |
| + size_t quad_count; |
| +}; |
| + |
| +void AddSurfaceQuad(TestRenderPass* pass, |
| + const gfx::Size& surface_size, |
| + int surface_id); |
| + |
| +void AddQuadInPass(TestRenderPass* pass, Quad desc); |
| + |
| +void AddPasses(RenderPassList* pass_list, |
| + const gfx::Rect& output_rect, |
| + Pass* passes, |
| + size_t pass_count); |
| + |
| +void TestPassMatchesExpectations(RenderPass* pass, Pass expected_pass); |
| + |
| +void TestPassesMatchExpectations(RenderPassList* passes, |
| + Pass* expected_passes, |
| + size_t expected_pass_count); |
| + |
| +void SubmitFrame(Pass* passes, size_t pass_count, Surface* surface); |
| + |
| +} // namespace test |
| +} // namespace cc |
| + |
| +#endif // CC_SURFACES_SURFACE_AGGREGATOR_TEST_HELPERS_H_ |