Commit d972fc7a authored by halliwell's avatar halliwell Committed by Commit bot

Enable underlay strategy by default in OverlayProcessor

Needed for cast_shell to use overlay system for video.

Review URL: https://codereview.chromium.org/1136153002

Cr-Commit-Position: refs/heads/master@{#329638}
parent c885020e
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "cc/output/output_surface.h" #include "cc/output/output_surface.h"
#include "cc/output/overlay_strategy_single_on_top.h" #include "cc/output/overlay_strategy_single_on_top.h"
#include "cc/output/overlay_strategy_underlay.h"
#include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/transform.h" #include "ui/gfx/transform.h"
...@@ -25,6 +26,8 @@ void OverlayProcessor::Initialize() { ...@@ -25,6 +26,8 @@ void OverlayProcessor::Initialize() {
if (candidates) { if (candidates) {
strategies_.push_back(scoped_ptr<Strategy>( strategies_.push_back(scoped_ptr<Strategy>(
new OverlayStrategySingleOnTop(candidates, resource_provider_))); new OverlayStrategySingleOnTop(candidates, resource_provider_)));
strategies_.push_back(scoped_ptr<Strategy>(
new OverlayStrategyUnderlay(candidates, resource_provider_)));
} }
} }
......
...@@ -304,7 +304,7 @@ TEST(OverlayTest, OverlaysProcessorHasStrategy) { ...@@ -304,7 +304,7 @@ TEST(OverlayTest, OverlaysProcessorHasStrategy) {
scoped_ptr<DefaultOverlayProcessor> overlay_processor( scoped_ptr<DefaultOverlayProcessor> overlay_processor(
new DefaultOverlayProcessor(&output_surface, resource_provider.get())); new DefaultOverlayProcessor(&output_surface, resource_provider.get()));
overlay_processor->Initialize(); overlay_processor->Initialize();
EXPECT_GE(1U, overlay_processor->GetStrategyCount()); EXPECT_GE(2U, overlay_processor->GetStrategyCount());
} }
template <typename OverlayStrategyType> template <typename OverlayStrategyType>
...@@ -948,10 +948,10 @@ TEST_F(GLRendererWithOverlaysTest, OverlayQuadNotDrawn) { ...@@ -948,10 +948,10 @@ TEST_F(GLRendererWithOverlaysTest, OverlayQuadNotDrawn) {
Mock::VerifyAndClearExpectations(&scheduler_); Mock::VerifyAndClearExpectations(&scheduler_);
} }
TEST_F(GLRendererWithOverlaysTest, OccludedQuadDrawn) { TEST_F(GLRendererWithOverlaysTest, OccludedQuadInUnderlay) {
bool use_validator = true; bool use_validator = true;
Init(use_validator); Init(use_validator);
renderer_->set_expect_overlays(false); renderer_->set_expect_overlays(true);
gfx::Rect viewport_rect(16, 16); gfx::Rect viewport_rect(16, 16);
scoped_ptr<RenderPass> pass = CreateRenderPass(); scoped_ptr<RenderPass> pass = CreateRenderPass();
...@@ -970,9 +970,12 @@ TEST_F(GLRendererWithOverlaysTest, OccludedQuadDrawn) { ...@@ -970,9 +970,12 @@ TEST_F(GLRendererWithOverlaysTest, OccludedQuadDrawn) {
RenderPassList pass_list; RenderPassList pass_list;
pass_list.push_back(pass.Pass()); pass_list.push_back(pass.Pass());
// 3 quads in the pass, all should draw. // Candidate quad should fail to be overlaid on top because of occlusion.
// Expect to be replaced with transparent hole quad and placed in underlay.
EXPECT_CALL(*renderer_, DoDrawQuad(_, _, _)).Times(3); EXPECT_CALL(*renderer_, DoDrawQuad(_, _, _)).Times(3);
EXPECT_CALL(scheduler_, Schedule(_, _, _, _, _)).Times(0); EXPECT_CALL(scheduler_,
Schedule(-1, gfx::OVERLAY_TRANSFORM_NONE, _, kOverlayRect,
BoundingRect(kUVTopLeft, kUVBottomRight))).Times(1);
renderer_->DrawFrame(&pass_list, 1.f, viewport_rect, viewport_rect, false); renderer_->DrawFrame(&pass_list, 1.f, viewport_rect, viewport_rect, false);
SwapBuffers(); SwapBuffers();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment