summaryrefslogtreecommitdiffstats
path: root/cc/quads/render_pass_unittest.cc
diff options
context:
space:
mode:
authoralexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 05:56:39 +0000
committeralexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 05:56:39 +0000
commit63880f8df2c37a295bf06d5174a502d5b3833d35 (patch)
tree033a3c0d8db3028760c1f1b954772af2336dc1f2 /cc/quads/render_pass_unittest.cc
parent47be222062b4141ef06182b47d198e6f4b8c88cc (diff)
downloadchromium_src-63880f8df2c37a295bf06d5174a502d5b3833d35.zip
chromium_src-63880f8df2c37a295bf06d5174a502d5b3833d35.tar.gz
chromium_src-63880f8df2c37a295bf06d5174a502d5b3833d35.tar.bz2
Start of hardware overlay support in CC with Ubercompositor.
I'm trying to introduce everything as small unit tested pieces. This adds some machinery for checking if quads inside a render pass could be placed into an overlay. A capability checker is added to the output surface, so that a particular overlay configuration could be validated against a specific display device. If an external monitor is plugged in, its output surface may behave differently that that of the primary on a laptop, for example. The intention is for OverlayCandidates checker to be created as part of BrowserCompositorOutputSurface where the actual hardware knowledge can be delegated to the Ozone platform and the HW specific bits can live there, leaving CC and content platform agnostic. BUG= Review URL: https://codereview.chromium.org/197223003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/quads/render_pass_unittest.cc')
-rw-r--r--cc/quads/render_pass_unittest.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc
index fd58523..1305741 100644
--- a/cc/quads/render_pass_unittest.cc
+++ b/cc/quads/render_pass_unittest.cc
@@ -31,6 +31,7 @@ struct RenderPassSize {
gfx::RectF damage_rect;
bool has_transparent_background;
ScopedPtrVector<CopyOutputRequest> copy_callbacks;
+ RenderPass::OverlayState overlay_state;
};
static void CompareRenderPassLists(const RenderPassList& expected_list,
@@ -47,6 +48,7 @@ static void CompareRenderPassLists(const RenderPassList& expected_list,
EXPECT_RECT_EQ(expected->damage_rect, actual->damage_rect);
EXPECT_EQ(expected->has_transparent_background,
actual->has_transparent_background);
+ EXPECT_EQ(expected->overlay_state, actual->overlay_state);
EXPECT_EQ(expected->shared_quad_state_list.size(),
actual->shared_quad_state_list.size());
@@ -69,13 +71,15 @@ TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) {
gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
gfx::Rect damage_rect(56, 123, 19, 43);
bool has_transparent_background = true;
+ RenderPass::OverlayState overlay_state = RenderPass::SIMPLE_OVERLAY;
scoped_ptr<TestRenderPass> pass = TestRenderPass::Create();
pass->SetAll(id,
output_rect,
damage_rect,
transform_to_root,
- has_transparent_background);
+ has_transparent_background,
+ overlay_state);
pass->copy_requests.push_back(CopyOutputRequest::CreateEmptyRequest());
// Stick a quad in the pass, this should not get copied.
@@ -103,6 +107,7 @@ TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) {
EXPECT_EQ(pass->transform_to_root_target, copy->transform_to_root_target);
EXPECT_RECT_EQ(pass->damage_rect, copy->damage_rect);
EXPECT_EQ(pass->has_transparent_background, copy->has_transparent_background);
+ EXPECT_EQ(pass->overlay_state, copy->overlay_state);
EXPECT_EQ(0u, copy->quad_list.size());
// The copy request should not be copied/duplicated.
@@ -121,13 +126,15 @@ TEST(RenderPassTest, CopyAllShouldBeIdentical) {
gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
gfx::Rect damage_rect(56, 123, 19, 43);
bool has_transparent_background = true;
+ RenderPass::OverlayState overlay_state = RenderPass::SIMPLE_OVERLAY;
scoped_ptr<TestRenderPass> pass = TestRenderPass::Create();
pass->SetAll(id,
output_rect,
damage_rect,
transform_to_root,
- has_transparent_background);
+ has_transparent_background,
+ overlay_state);
// Two quads using one shared state.
scoped_ptr<SharedQuadState> shared_state1 = SharedQuadState::Create();
@@ -190,13 +197,15 @@ TEST(RenderPassTest, CopyAllShouldBeIdentical) {
gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
gfx::Rect contrib_damage_rect(11, 16, 10, 15);
bool contrib_has_transparent_background = true;
+ RenderPass::OverlayState contrib_overlay_state = RenderPass::SIMPLE_OVERLAY;
scoped_ptr<TestRenderPass> contrib = TestRenderPass::Create();
contrib->SetAll(contrib_id,
contrib_output_rect,
contrib_damage_rect,
contrib_transform_to_root,
- contrib_has_transparent_background);
+ contrib_has_transparent_background,
+ contrib_overlay_state);
scoped_ptr<SharedQuadState> contrib_shared_state = SharedQuadState::Create();
contrib_shared_state->SetAll(gfx::Transform(),
@@ -249,13 +258,15 @@ TEST(RenderPassTest, CopyAllWithCulledQuads) {
gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
gfx::Rect damage_rect(56, 123, 19, 43);
bool has_transparent_background = true;
+ RenderPass::OverlayState overlay_state = RenderPass::SIMPLE_OVERLAY;
scoped_ptr<TestRenderPass> pass = TestRenderPass::Create();
pass->SetAll(id,
output_rect,
damage_rect,
transform_to_root,
- has_transparent_background);
+ has_transparent_background,
+ overlay_state);
// A shared state with a quad.
scoped_ptr<SharedQuadState> shared_state1 = SharedQuadState::Create();