| 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 Wait(main_thread_); | 629 Wait(main_thread_); |
| 630 | 630 |
| 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 const RendererSettings& renderer_settings, |
| 639 scoped_refptr<ContextProvider> compositor_context_provider, | 640 scoped_refptr<ContextProvider> compositor_context_provider, |
| 640 scoped_refptr<ContextProvider> worker_context_provider) override { | 641 scoped_refptr<ContextProvider> worker_context_provider) override { |
| 641 constexpr bool kDisableDisplayVsync = false; | 642 constexpr bool disable_display_vsync = false; |
| 642 bool synchronous_composite = | 643 bool synchronous_composite = |
| 643 !HasImplThread() && | 644 !HasImplThread() && |
| 644 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 645 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
| 645 return base::MakeUnique<TestCompositorFrameSink>( | 646 return base::MakeUnique<TestCompositorFrameSink>( |
| 646 compositor_context_provider, std::move(worker_context_provider), | 647 compositor_context_provider, std::move(worker_context_provider), |
| 647 shared_bitmap_manager(), gpu_memory_buffer_manager(), | 648 shared_bitmap_manager(), gpu_memory_buffer_manager(), renderer_settings, |
| 648 layer_tree_host()->GetSettings().renderer_settings, | 649 ImplThreadTaskRunner(), synchronous_composite, disable_display_vsync); |
| 649 ImplThreadTaskRunner(), synchronous_composite, kDisableDisplayVsync); | |
| 650 } | 650 } |
| 651 | 651 |
| 652 void AdvanceTestCase() { | 652 void AdvanceTestCase() { |
| 653 ++test_case_; | 653 ++test_case_; |
| 654 switch (test_case_) { | 654 switch (test_case_) { |
| 655 case 1: | 655 case 1: |
| 656 // Case #1: change mailbox before the commit. The old mailbox should be | 656 // Case #1: change mailbox before the commit. The old mailbox should be |
| 657 // released immediately. | 657 // released immediately. |
| 658 SetMailbox('2'); | 658 SetMailbox('2'); |
| 659 EXPECT_EQ(1, callback_count_); | 659 EXPECT_EQ(1, callback_count_); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 base::ThreadChecker main_thread_; | 1485 base::ThreadChecker main_thread_; |
| 1486 int callback_count_; | 1486 int callback_count_; |
| 1487 scoped_refptr<Layer> root_; | 1487 scoped_refptr<Layer> root_; |
| 1488 scoped_refptr<TextureLayer> layer_; | 1488 scoped_refptr<TextureLayer> layer_; |
| 1489 }; | 1489 }; |
| 1490 | 1490 |
| 1491 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); | 1491 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); |
| 1492 | 1492 |
| 1493 } // namespace | 1493 } // namespace |
| 1494 } // namespace cc | 1494 } // namespace cc |
| OLD | NEW |