OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 pass->shared_quad_state_list.back(), pass.get()); | 416 pass->shared_quad_state_list.back(), pass.get()); |
417 | 417 |
418 // Check for potential candidates. | 418 // Check for potential candidates. |
419 OverlayCandidateList candidate_list; | 419 OverlayCandidateList candidate_list; |
420 overlay_processor_->ProcessForOverlays(resource_provider_.get(), pass.get(), | 420 overlay_processor_->ProcessForOverlays(resource_provider_.get(), pass.get(), |
421 &candidate_list, nullptr, | 421 &candidate_list, nullptr, |
422 &damage_rect_); | 422 &damage_rect_); |
423 ASSERT_EQ(1U, candidate_list.size()); | 423 ASSERT_EQ(1U, candidate_list.size()); |
424 | 424 |
425 RenderPass* main_pass = pass.get(); | 425 RenderPass* main_pass = pass.get(); |
426 // Check that the quad is gone. | 426 // Check that all the quads are gone. |
427 EXPECT_EQ(1U, main_pass->quad_list.size()); | 427 EXPECT_EQ(0U, main_pass->quad_list.size()); |
| 428 // Check that we have only one overlay. |
| 429 EXPECT_EQ(1U, candidate_list.size()); |
428 // Check that the right resource id got extracted. | 430 // Check that the right resource id got extracted. |
429 EXPECT_EQ(original_resource_id, candidate_list.back().resource_id); | 431 EXPECT_EQ(original_resource_id, candidate_list.front().resource_id); |
430 } | 432 } |
431 | 433 |
432 TEST_F(FullscreenOverlayTest, ResourceSizeInPixelsFail) { | 434 TEST_F(FullscreenOverlayTest, ResourceSizeInPixelsFail) { |
433 std::unique_ptr<RenderPass> pass = CreateRenderPass(); | 435 std::unique_ptr<RenderPass> pass = CreateRenderPass(); |
434 TextureDrawQuad* original_quad = CreateFullscreenCandidateQuad( | 436 TextureDrawQuad* original_quad = CreateFullscreenCandidateQuad( |
435 resource_provider_.get(), pass->shared_quad_state_list.back(), | 437 resource_provider_.get(), pass->shared_quad_state_list.back(), |
436 pass.get()); | 438 pass.get()); |
437 original_quad->set_resource_size_in_pixels(gfx::Size(64, 64)); | 439 original_quad->set_resource_size_in_pixels(gfx::Size(64, 64)); |
438 | 440 |
439 // Check for potential candidates. | 441 // Check for potential candidates. |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 filters_.Append(FilterOperation::CreateZoomFilter(0.9f, 1)); | 1872 filters_.Append(FilterOperation::CreateZoomFilter(0.9f, 1)); |
1871 quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect, | 1873 quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect, |
1872 kOverlayRect, render_pass_id_, 0, gfx::Vector2dF(), gfx::Size(), | 1874 kOverlayRect, render_pass_id_, 0, gfx::Vector2dF(), gfx::Size(), |
1873 filters_, gfx::Vector2dF(1, 1), background_filters_); | 1875 filters_, gfx::Vector2dF(1, 1), background_filters_); |
1874 ProcessForOverlays(); | 1876 ProcessForOverlays(); |
1875 EXPECT_EQ(0U, ca_layer_list_.size()); | 1877 EXPECT_EQ(0U, ca_layer_list_.size()); |
1876 } | 1878 } |
1877 | 1879 |
1878 } // namespace | 1880 } // namespace |
1879 } // namespace cc | 1881 } // namespace cc |
OLD | NEW |