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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 bool synchronous_composite = | 641 bool synchronous_composite = |
642 !HasImplThread() && | 642 !HasImplThread() && |
643 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; | 643 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; |
644 // Allow relaim resources for this test so that mailboxes in the display | |
645 // will be returned inside the commit that replaces them. | |
646 bool force_disable_reclaim_resources = false; | |
647 return base::MakeUnique<TestCompositorFrameSink>( | 644 return base::MakeUnique<TestCompositorFrameSink>( |
648 compositor_context_provider, std::move(worker_context_provider), | 645 compositor_context_provider, std::move(worker_context_provider), |
649 shared_bitmap_manager(), gpu_memory_buffer_manager(), | 646 shared_bitmap_manager(), gpu_memory_buffer_manager(), |
650 layer_tree_host()->GetSettings().renderer_settings, | 647 layer_tree_host()->GetSettings().renderer_settings, |
651 ImplThreadTaskRunner(), synchronous_composite, | 648 ImplThreadTaskRunner(), synchronous_composite); |
652 force_disable_reclaim_resources); | |
653 } | 649 } |
654 | 650 |
655 void AdvanceTestCase() { | 651 void AdvanceTestCase() { |
656 ++test_case_; | 652 ++test_case_; |
657 switch (test_case_) { | 653 switch (test_case_) { |
658 case 1: | 654 case 1: |
659 // Case #1: change mailbox before the commit. The old mailbox should be | 655 // Case #1: change mailbox before the commit. The old mailbox should be |
660 // released immediately. | 656 // released immediately. |
661 SetMailbox('2'); | 657 SetMailbox('2'); |
662 EXPECT_EQ(1, callback_count_); | 658 EXPECT_EQ(1, callback_count_); |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 base::ThreadChecker main_thread_; | 1484 base::ThreadChecker main_thread_; |
1489 int callback_count_; | 1485 int callback_count_; |
1490 scoped_refptr<Layer> root_; | 1486 scoped_refptr<Layer> root_; |
1491 scoped_refptr<TextureLayer> layer_; | 1487 scoped_refptr<TextureLayer> layer_; |
1492 }; | 1488 }; |
1493 | 1489 |
1494 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); | 1490 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); |
1495 | 1491 |
1496 } // namespace | 1492 } // namespace |
1497 } // namespace cc | 1493 } // namespace cc |
OLD | NEW |