| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/layers/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 Mock::VerifyAndClearExpectations(&test_data_.mock_callback_); | 631 Mock::VerifyAndClearExpectations(&test_data_.mock_callback_); |
| 632 } | 632 } |
| 633 | 633 |
| 634 class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { | 634 class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { |
| 635 public: | 635 public: |
| 636 TextureLayerImplWithMailboxThreadedCallback() = default; | 636 TextureLayerImplWithMailboxThreadedCallback() = default; |
| 637 | 637 |
| 638 std::unique_ptr<TestCompositorFrameSink> CreateCompositorFrameSink( | 638 std::unique_ptr<TestCompositorFrameSink> CreateCompositorFrameSink( |
| 639 scoped_refptr<ContextProvider> compositor_context_provider, | 639 scoped_refptr<ContextProvider> compositor_context_provider, |
| 640 scoped_refptr<ContextProvider> worker_context_provider) override { | 640 scoped_refptr<ContextProvider> worker_context_provider) override { |
| 641 constexpr bool kDisableDisplayVsync = false; | 641 constexpr bool disable_display_vsync = false; |
| 642 RendererSettings renderer_settings; |
| 643 InitializeRendererSettings(&renderer_settings); |
| 642 bool synchronous_composite = | 644 bool synchronous_composite = |
| 643 !HasImplThread() && | 645 !HasImplThread() && |
| 644 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 646 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
| 645 return base::MakeUnique<TestCompositorFrameSink>( | 647 return base::MakeUnique<TestCompositorFrameSink>( |
| 646 compositor_context_provider, std::move(worker_context_provider), | 648 compositor_context_provider, std::move(worker_context_provider), |
| 647 shared_bitmap_manager(), gpu_memory_buffer_manager(), | 649 shared_bitmap_manager(), gpu_memory_buffer_manager(), renderer_settings, |
| 648 layer_tree_host()->GetSettings().renderer_settings, | 650 ImplThreadTaskRunner(), synchronous_composite, disable_display_vsync); |
| 649 ImplThreadTaskRunner(), synchronous_composite, kDisableDisplayVsync); | |
| 650 } | 651 } |
| 651 | 652 |
| 652 void AdvanceTestCase() { | 653 void AdvanceTestCase() { |
| 653 ++test_case_; | 654 ++test_case_; |
| 654 switch (test_case_) { | 655 switch (test_case_) { |
| 655 case 1: | 656 case 1: |
| 656 // Case #1: change mailbox before the commit. The old mailbox should be | 657 // Case #1: change mailbox before the commit. The old mailbox should be |
| 657 // released immediately. | 658 // released immediately. |
| 658 SetMailbox('2'); | 659 SetMailbox('2'); |
| 659 EXPECT_EQ(1, callback_count_); | 660 EXPECT_EQ(1, callback_count_); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 base::ThreadChecker main_thread_; | 1486 base::ThreadChecker main_thread_; |
| 1486 int callback_count_; | 1487 int callback_count_; |
| 1487 scoped_refptr<Layer> root_; | 1488 scoped_refptr<Layer> root_; |
| 1488 scoped_refptr<TextureLayer> layer_; | 1489 scoped_refptr<TextureLayer> layer_; |
| 1489 }; | 1490 }; |
| 1490 | 1491 |
| 1491 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); | 1492 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); |
| 1492 | 1493 |
| 1493 } // namespace | 1494 } // namespace |
| 1494 } // namespace cc | 1495 } // namespace cc |
| OLD | NEW |