Chromium Code Reviews| Index: cc/output/overlay_unittest.cc |
| diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc |
| index 5e63246c802330a91f7a59f992c2041f09664448..8845af5440cef3b886e0b676b718d639a5158729 100644 |
| --- a/cc/output/overlay_unittest.cc |
| +++ b/cc/output/overlay_unittest.cc |
| @@ -77,11 +77,8 @@ void SingleOverlayValidator::CheckOverlaySupport( |
| template <typename OverlayStrategyType> |
| class SingleOverlayProcessor : public OverlayProcessor { |
| public: |
| - SingleOverlayProcessor(OutputSurface* surface, |
| - ResourceProvider* resource_provider) |
| - : OverlayProcessor(surface, resource_provider) { |
| + SingleOverlayProcessor(OutputSurface* surface) : OverlayProcessor(surface) { |
| EXPECT_EQ(surface, surface_); |
| - EXPECT_EQ(resource_provider, resource_provider_); |
| } |
| // Virtual to allow testing different strategies. |
| @@ -89,22 +86,20 @@ class SingleOverlayProcessor : public OverlayProcessor { |
| OverlayCandidateValidator* candidates = |
| surface_->GetOverlayCandidateValidator(); |
| ASSERT_TRUE(candidates != NULL); |
| - strategies_.push_back(scoped_ptr<Strategy>( |
| - new OverlayStrategyType(candidates, resource_provider_))); |
| + strategies_.push_back( |
| + scoped_ptr<Strategy>(new OverlayStrategyType(candidates))); |
| } |
| }; |
| class DefaultOverlayProcessor : public OverlayProcessor { |
| public: |
| - DefaultOverlayProcessor(OutputSurface* surface, |
| - ResourceProvider* resource_provider); |
| + DefaultOverlayProcessor(OutputSurface* surface); |
| size_t GetStrategyCount(); |
| }; |
| -DefaultOverlayProcessor::DefaultOverlayProcessor( |
| - OutputSurface* surface, |
| - ResourceProvider* resource_provider) |
| - : OverlayProcessor(surface, resource_provider) {} |
| +DefaultOverlayProcessor::DefaultOverlayProcessor(OutputSurface* surface) |
| + : OverlayProcessor(surface) { |
| +} |
| size_t DefaultOverlayProcessor::GetStrategyCount() { |
| return strategies_.size(); |
| @@ -156,7 +151,6 @@ ResourceId CreateResource(ResourceProvider* resource_provider) { |
| unsigned sync_point = 0; |
| TextureMailbox mailbox = |
| TextureMailbox(gpu::Mailbox::Generate(), GL_TEXTURE_2D, sync_point); |
| - mailbox.set_allow_overlay(true); |
| scoped_ptr<SingleReleaseCallbackImpl> release_callback = |
| SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased)); |
| @@ -184,6 +178,8 @@ TextureDrawQuad* CreateCandidateQuadAt(ResourceProvider* resource_provider, |
| bool flipped = false; |
| bool nearest_neighbor = false; |
| float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; |
| + gfx::Size resource_size_in_pixels = gfx::Size(64, 64); |
| + bool allow_overlay = true; |
| TextureDrawQuad* overlay_quad = |
| render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| @@ -199,6 +195,8 @@ TextureDrawQuad* CreateCandidateQuadAt(ResourceProvider* resource_provider, |
| vertex_opacity, |
| flipped, |
| nearest_neighbor); |
| + overlay_quad->allow_overlay = allow_overlay; |
|
danakj
2015/06/01 17:31:29
can you add these to SetNew for this quad type too
achaulk
2015/06/01 21:27:22
It seems a bit of a waste to add them everywhere f
danakj
2015/06/01 21:36:43
Oh, I figured all the code paths are setting these
|
| + overlay_quad->resource_size_in_pixels = resource_size_in_pixels; |
| return overlay_quad; |
| } |
| @@ -210,11 +208,15 @@ StreamVideoDrawQuad* CreateCandidateVideoQuadAt( |
| const gfx::Rect& rect, |
| const gfx::Transform& transform) { |
| ResourceId resource_id = CreateResource(resource_provider); |
| + gfx::Size resource_size_in_pixels = gfx::Size(64, 64); |
| + bool allow_overlay = true; |
| StreamVideoDrawQuad* overlay_quad = |
| render_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
| overlay_quad->SetNew(shared_quad_state, rect, rect, rect, resource_id, |
| transform); |
| + overlay_quad->allow_overlay = allow_overlay; |
| + overlay_quad->resource_size_in_pixels = resource_size_in_pixels; |
| return overlay_quad; |
| } |
| @@ -305,7 +307,7 @@ TEST(OverlayTest, OverlaysProcessorHasStrategy) { |
| &output_surface, shared_bitmap_manager.get(), NULL, NULL, 0, false, 1)); |
| scoped_ptr<DefaultOverlayProcessor> overlay_processor( |
| - new DefaultOverlayProcessor(&output_surface, resource_provider.get())); |
| + new DefaultOverlayProcessor(&output_surface)); |
| overlay_processor->Initialize(); |
| EXPECT_GE(2U, overlay_processor->GetStrategyCount()); |
| } |
| @@ -329,8 +331,8 @@ class OverlayTest : public testing::Test { |
| false, |
| 1); |
| - overlay_processor_.reset(new SingleOverlayProcessor<OverlayStrategyType>( |
| - output_surface_.get(), resource_provider_.get())); |
| + overlay_processor_.reset( |
| + new SingleOverlayProcessor<OverlayStrategyType>(output_surface_.get())); |
| overlay_processor_->Initialize(); |
| } |