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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 TextureMailbox mailbox2_; | 198 TextureMailbox mailbox2_; |
199 TextureMailbox mailbox3_; | 199 TextureMailbox mailbox3_; |
200 gpu::SyncToken sync_token1_; | 200 gpu::SyncToken sync_token1_; |
201 gpu::SyncToken sync_token2_; | 201 gpu::SyncToken sync_token2_; |
202 std::unique_ptr<SharedBitmap> shared_bitmap_; | 202 std::unique_ptr<SharedBitmap> shared_bitmap_; |
203 }; | 203 }; |
204 | 204 |
205 class TextureLayerTest : public testing::Test { | 205 class TextureLayerTest : public testing::Test { |
206 public: | 206 public: |
207 TextureLayerTest() | 207 TextureLayerTest() |
208 : fake_client_( | 208 : output_surface_(FakeOutputSurface::CreateDelegating3d()), |
209 FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D)), | |
210 output_surface_(FakeOutputSurface::Create3d()), | |
211 host_impl_(&task_runner_provider_, | 209 host_impl_(&task_runner_provider_, |
212 &shared_bitmap_manager_, | 210 &shared_bitmap_manager_, |
213 &task_graph_runner_), | 211 &task_graph_runner_), |
214 test_data_(&shared_bitmap_manager_) {} | 212 test_data_(&shared_bitmap_manager_) {} |
215 | 213 |
216 protected: | 214 protected: |
217 void SetUp() override { | 215 void SetUp() override { |
218 layer_tree_host_ = | 216 layer_tree_host_ = |
219 MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_); | 217 MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_); |
220 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber()); | 218 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber()); |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 int activate_count_; | 832 int activate_count_; |
835 scoped_refptr<Layer> root_; | 833 scoped_refptr<Layer> root_; |
836 scoped_refptr<TextureLayer> layer_; | 834 scoped_refptr<TextureLayer> layer_; |
837 }; | 835 }; |
838 | 836 |
839 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 837 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
840 TextureLayerMailboxIsActivatedDuringCommit); | 838 TextureLayerMailboxIsActivatedDuringCommit); |
841 | 839 |
842 class TextureLayerImplWithMailboxTest : public TextureLayerTest { | 840 class TextureLayerImplWithMailboxTest : public TextureLayerTest { |
843 protected: | 841 protected: |
844 TextureLayerImplWithMailboxTest() | |
845 : fake_client_( | |
846 FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D)) {} | |
847 | |
848 void SetUp() override { | 842 void SetUp() override { |
849 TextureLayerTest::SetUp(); | 843 TextureLayerTest::SetUp(); |
850 layer_tree_host_ = | 844 layer_tree_host_ = |
851 MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_); | 845 MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_); |
852 host_impl_.SetVisible(true); | 846 host_impl_.SetVisible(true); |
853 EXPECT_TRUE(host_impl_.InitializeRenderer(output_surface_.get())); | 847 EXPECT_TRUE(host_impl_.InitializeRenderer(output_surface_.get())); |
854 } | 848 } |
855 | 849 |
856 bool WillDraw(TextureLayerImpl* layer, DrawMode mode) { | 850 bool WillDraw(TextureLayerImpl* layer, DrawMode mode) { |
857 bool will_draw = layer->WillDraw( | 851 bool will_draw = layer->WillDraw( |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 int callback_count_; | 1445 int callback_count_; |
1452 scoped_refptr<Layer> root_; | 1446 scoped_refptr<Layer> root_; |
1453 scoped_refptr<TextureLayer> layer_; | 1447 scoped_refptr<TextureLayer> layer_; |
1454 }; | 1448 }; |
1455 | 1449 |
1456 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1450 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
1457 TextureLayerWithMailboxImplThreadDeleted); | 1451 TextureLayerWithMailboxImplThreadDeleted); |
1458 | 1452 |
1459 } // namespace | 1453 } // namespace |
1460 } // namespace cc | 1454 } // namespace cc |
OLD | NEW |