| Index: cc/output/overlay_unittest.cc
|
| diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc
|
| index 722002e5580e203359fbbd4a954afac2844179c7..f1706099aaa69a1f659ab4229d2a476117d9559a 100644
|
| --- a/cc/output/overlay_unittest.cc
|
| +++ b/cc/output/overlay_unittest.cc
|
| @@ -65,6 +65,7 @@ class SingleOverlayValidator : public OverlayCandidateValidator {
|
| make_scoped_ptr(new OverlayStrategySingleOnTop(this)));
|
| strategies->push_back(make_scoped_ptr(new OverlayStrategyUnderlay(this)));
|
| }
|
| + bool IsSupportedQuad(const DrawQuad* quad) override { return true; }
|
| void CheckOverlaySupport(OverlayCandidateList* surfaces) override {
|
| // We may have 1 or 2 surfaces depending on whether this ran through the
|
| // full renderer and picked up the output surface, or not.
|
| @@ -72,7 +73,7 @@ class SingleOverlayValidator : public OverlayCandidateValidator {
|
| ASSERT_GE(2U, surfaces->size());
|
|
|
| OverlayCandidate& candidate = surfaces->back();
|
| - EXPECT_TRUE(!candidate.use_output_surface_for_resource);
|
| + EXPECT_EQ(OverlayCandidate::HAS_RESOURCE, candidate.resource_type);
|
| if (candidate.display_rect.width() == 64) {
|
| EXPECT_EQ(gfx::RectF(kOverlayBottomRightRect), candidate.display_rect);
|
| } else {
|
| @@ -112,6 +113,7 @@ class SandwichOverlayValidator : public OverlayCandidateValidator {
|
| void GetStrategies(OverlayProcessor::StrategyList* strategies) override {
|
| strategies->push_back(make_scoped_ptr(new OverlayStrategySandwich(this)));
|
| }
|
| + bool IsSupportedQuad(const DrawQuad* quad) override { return true; }
|
| void CheckOverlaySupport(OverlayCandidateList* surfaces) override {
|
| for (OverlayCandidate& candidate : *surfaces)
|
| candidate.overlay_handled = true;
|
| @@ -124,6 +126,7 @@ class AllOrNothingOverlayValidator : public OverlayCandidateValidator {
|
| strategies->push_back(
|
| make_scoped_ptr(new OverlayStrategyAllOrNothing(this)));
|
| }
|
| + bool IsSupportedQuad(const DrawQuad* quad) override { return true; }
|
| void CheckOverlaySupport(OverlayCandidateList* surfaces) override {
|
| for (OverlayCandidate& candidate : *surfaces)
|
| candidate.overlay_handled = true;
|
| @@ -434,7 +437,7 @@ TEST_F(SandwichTest, SuccessfulSingleOverlay) {
|
| }
|
|
|
| // Check that the right resource id got extracted.
|
| - EXPECT_EQ(original_resource_id, candidate_list.back().resource_id);
|
| + EXPECT_EQ(original_resource_id, candidate_list.back().resource.resource_id);
|
| }
|
|
|
| TEST_F(SandwichTest, CroppedSingleOverlay) {
|
| @@ -466,7 +469,7 @@ TEST_F(SandwichTest, CroppedSingleOverlay) {
|
| // Ensure that the display and uv rects have cropping applied to them.
|
| ASSERT_EQ(1U, pass_list.size());
|
| ASSERT_EQ(1U, candidate_list.size());
|
| - EXPECT_EQ(candidate_id, candidate_list[0].resource_id);
|
| + EXPECT_EQ(candidate_id, candidate_list[0].resource.resource_id);
|
| EXPECT_EQ(gfx::RectF(0.f, 32.f, 64.f, 64.f), candidate_list[0].display_rect);
|
| EXPECT_EQ(gfx::RectF(0.f, 0.25f, 0.5f, 0.5f), candidate_list[0].uv_rect);
|
| }
|
| @@ -573,9 +576,10 @@ TEST_F(SandwichTest, SuccessfulSandwichOverlay) {
|
| EXPECT_NE(DrawQuad::TEXTURE_CONTENT, it->material);
|
| }
|
|
|
| - EXPECT_EQ(candidate_id, candidate_list[0].resource_id);
|
| + EXPECT_EQ(candidate_id, candidate_list[0].resource.resource_id);
|
| EXPECT_EQ(gfx::RectF(32.f, 32.f, 32.f, 32.f), candidate_list[0].display_rect);
|
| - EXPECT_TRUE(candidate_list[1].use_output_surface_for_resource);
|
| + EXPECT_EQ(OverlayCandidate::USE_OUTPUT_SURFACE,
|
| + candidate_list[1].resource_type);
|
| EXPECT_EQ(gfx::RectF(32.f, 32.f, 16.f, 16.f), candidate_list[1].display_rect);
|
| EXPECT_EQ(gfx::RectF(32.f / 256.f, 32.f / 256.f, 16.f / 256.f, 16.f / 256.f),
|
| candidate_list[1].uv_rect);
|
| @@ -637,10 +641,12 @@ TEST_F(SandwichTest, MultiQuadOverlay) {
|
| DCHECK(covered_region == transparent_quad_region);
|
|
|
| // Check that overlays cover the same region that the quads covered.
|
| - EXPECT_EQ(candidate_id, candidate_list[0].resource_id);
|
| + EXPECT_EQ(candidate_id, candidate_list[0].resource.resource_id);
|
| EXPECT_EQ(gfx::RectF(64.f, 64.f), candidate_list[0].display_rect);
|
| - EXPECT_TRUE(candidate_list[1].use_output_surface_for_resource);
|
| - EXPECT_TRUE(candidate_list[2].use_output_surface_for_resource);
|
| + EXPECT_EQ(OverlayCandidate::USE_OUTPUT_SURFACE,
|
| + candidate_list[1].resource_type);
|
| + EXPECT_EQ(OverlayCandidate::USE_OUTPUT_SURFACE,
|
| + candidate_list[2].resource_type);
|
| Region overlay_region;
|
| overlay_region.Union(gfx::ToEnclosingRect(candidate_list[1].display_rect));
|
| overlay_region.Union(gfx::ToEnclosingRect(candidate_list[2].display_rect));
|
| @@ -683,7 +689,7 @@ TEST_F(SingleOverlayOnTopTest, SuccessfullOverlay) {
|
| }
|
|
|
| // Check that the right resource id got extracted.
|
| - EXPECT_EQ(original_resource_id, candidate_list.back().resource_id);
|
| + EXPECT_EQ(original_resource_id, candidate_list.back().resource.resource_id);
|
| }
|
|
|
| TEST_F(SingleOverlayOnTopTest, NoCandidates) {
|
| @@ -1314,7 +1320,7 @@ class OverlayInfoRendererGL : public GLRenderer {
|
| }
|
|
|
| ASSERT_EQ(2U, frame->overlay_list.size());
|
| - EXPECT_NE(0U, frame->overlay_list.back().resource_id);
|
| + EXPECT_NE(0U, frame->overlay_list.back().resource.resource_id);
|
| }
|
|
|
| void set_expect_overlays(bool expect_overlays) {
|
| @@ -1504,25 +1510,28 @@ TEST_F(GLRendererWithOverlaysTest, ResourcesExportedAndReturnedWithDelay) {
|
| DirectRenderer::DrawingFrame frame1;
|
| frame1.render_passes_in_draw_order = &pass_list;
|
| frame1.overlay_list.resize(2);
|
| - frame1.overlay_list.front().use_output_surface_for_resource = true;
|
| + frame1.overlay_list.front().resource_type =
|
| + OverlayCandidate::USE_OUTPUT_SURFACE;
|
| OverlayCandidate& overlay1 = frame1.overlay_list.back();
|
| - overlay1.resource_id = resource1;
|
| + overlay1.resource.resource_id = resource1;
|
| overlay1.plane_z_order = 1;
|
|
|
| DirectRenderer::DrawingFrame frame2;
|
| frame2.render_passes_in_draw_order = &pass_list;
|
| frame2.overlay_list.resize(2);
|
| - frame2.overlay_list.front().use_output_surface_for_resource = true;
|
| + frame2.overlay_list.front().resource_type =
|
| + OverlayCandidate::USE_OUTPUT_SURFACE;
|
| OverlayCandidate& overlay2 = frame2.overlay_list.back();
|
| - overlay2.resource_id = resource2;
|
| + overlay2.resource.resource_id = resource2;
|
| overlay2.plane_z_order = 1;
|
|
|
| DirectRenderer::DrawingFrame frame3;
|
| frame3.render_passes_in_draw_order = &pass_list;
|
| frame3.overlay_list.resize(2);
|
| - frame3.overlay_list.front().use_output_surface_for_resource = true;
|
| + frame3.overlay_list.front().resource_type =
|
| + OverlayCandidate::USE_OUTPUT_SURFACE;
|
| OverlayCandidate& overlay3 = frame3.overlay_list.back();
|
| - overlay3.resource_id = resource3;
|
| + overlay3.resource.resource_id = resource3;
|
| overlay3.plane_z_order = 1;
|
|
|
| EXPECT_CALL(scheduler_, Schedule(_, _, _, _, _)).Times(2);
|
|
|