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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "cc/base/thread.h" | 10 #include "cc/base/thread.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 TEST_F(TextureLayerImplWithMailboxTest, | 478 TEST_F(TextureLayerImplWithMailboxTest, |
479 TestDestructorCallbackOnCreatedResource) { | 479 TestDestructorCallbackOnCreatedResource) { |
480 scoped_ptr<TextureLayerImpl> impl_layer; | 480 scoped_ptr<TextureLayerImpl> impl_layer; |
481 impl_layer = TextureLayerImpl::Create(host_impl_.active_tree(), 1, true); | 481 impl_layer = TextureLayerImpl::Create(host_impl_.active_tree(), 1, true); |
482 ASSERT_TRUE(impl_layer); | 482 ASSERT_TRUE(impl_layer); |
483 | 483 |
484 EXPECT_CALL(test_data_.mock_callback_, | 484 EXPECT_CALL(test_data_.mock_callback_, |
485 Release(test_data_.mailbox_name1_, _, false)) | 485 Release(test_data_.mailbox_name1_, _, false)) |
486 .Times(1); | 486 .Times(1); |
487 impl_layer->SetTextureMailbox(test_data_.mailbox1_); | 487 impl_layer->SetTextureMailbox(test_data_.mailbox1_); |
488 impl_layer->WillDraw(host_impl_.active_tree()->resource_provider()); | 488 impl_layer->set_texture_id(1); |
| 489 EXPECT_TRUE(impl_layer->WillDraw( |
| 490 DRAW_MODE_HARDWARE, host_impl_.active_tree()->resource_provider())); |
489 impl_layer->DidDraw(host_impl_.active_tree()->resource_provider()); | 491 impl_layer->DidDraw(host_impl_.active_tree()->resource_provider()); |
490 impl_layer->SetTextureMailbox(TextureMailbox()); | 492 impl_layer->SetTextureMailbox(TextureMailbox()); |
491 } | 493 } |
492 | 494 |
493 TEST_F(TextureLayerImplWithMailboxTest, TestCallbackOnInUseResource) { | 495 TEST_F(TextureLayerImplWithMailboxTest, TestCallbackOnInUseResource) { |
494 ResourceProvider* provider = host_impl_.active_tree()->resource_provider(); | 496 ResourceProvider* provider = host_impl_.active_tree()->resource_provider(); |
495 ResourceProvider::ResourceId id = | 497 ResourceProvider::ResourceId id = |
496 provider->CreateResourceFromTextureMailbox(test_data_.mailbox1_); | 498 provider->CreateResourceFromTextureMailbox(test_data_.mailbox1_); |
497 provider->AllocateForTesting(id); | 499 provider->AllocateForTesting(id); |
498 | 500 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 base::Lock lock_; | 625 base::Lock lock_; |
624 unsigned expected_used_textures_on_commit_; | 626 unsigned expected_used_textures_on_commit_; |
625 }; | 627 }; |
626 | 628 |
627 // The TextureLayerClient does not use mailboxes, so can't use a delegating | 629 // The TextureLayerClient does not use mailboxes, so can't use a delegating |
628 // renderer. | 630 // renderer. |
629 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerClientTest); | 631 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerClientTest); |
630 | 632 |
631 } // namespace | 633 } // namespace |
632 } // namespace cc | 634 } // namespace cc |
OLD | NEW |