| 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/debug/test_web_graphics_context_3d.h" | 10 #include "cc/debug/test_web_graphics_context_3d.h" |
| 11 #include "cc/layers/texture_layer_client.h" | 11 #include "cc/layers/texture_layer_client.h" |
| 12 #include "cc/layers/texture_layer_impl.h" | 12 #include "cc/layers/texture_layer_impl.h" |
| 13 #include "cc/resources/returned_resource.h" |
| 13 #include "cc/test/fake_impl_proxy.h" | 14 #include "cc/test/fake_impl_proxy.h" |
| 14 #include "cc/test/fake_layer_tree_host_client.h" | 15 #include "cc/test/fake_layer_tree_host_client.h" |
| 15 #include "cc/test/fake_layer_tree_host_impl.h" | 16 #include "cc/test/fake_layer_tree_host_impl.h" |
| 16 #include "cc/test/fake_output_surface.h" | 17 #include "cc/test/fake_output_surface.h" |
| 17 #include "cc/test/layer_test_common.h" | 18 #include "cc/test/layer_test_common.h" |
| 18 #include "cc/test/layer_tree_test.h" | 19 #include "cc/test/layer_tree_test.h" |
| 19 #include "cc/trees/layer_tree_host.h" | 20 #include "cc/trees/layer_tree_host.h" |
| 20 #include "cc/trees/layer_tree_impl.h" | 21 #include "cc/trees/layer_tree_impl.h" |
| 21 #include "cc/trees/single_thread_proxy.h" | 22 #include "cc/trees/single_thread_proxy.h" |
| 22 #include "gpu/GLES2/gl2extchromium.h" | 23 #include "gpu/GLES2/gl2extchromium.h" |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 resource_ids_to_transfer.push_back(id); | 779 resource_ids_to_transfer.push_back(id); |
| 779 TransferableResourceArray list; | 780 TransferableResourceArray list; |
| 780 provider->PrepareSendToParent(resource_ids_to_transfer, &list); | 781 provider->PrepareSendToParent(resource_ids_to_transfer, &list); |
| 781 EXPECT_TRUE(provider->InUseByConsumer(id)); | 782 EXPECT_TRUE(provider->InUseByConsumer(id)); |
| 782 EXPECT_CALL(test_data_.mock_callback_, Release(_, _, _)).Times(0); | 783 EXPECT_CALL(test_data_.mock_callback_, Release(_, _, _)).Times(0); |
| 783 provider->DeleteResource(id); | 784 provider->DeleteResource(id); |
| 784 Mock::VerifyAndClearExpectations(&test_data_.mock_callback_); | 785 Mock::VerifyAndClearExpectations(&test_data_.mock_callback_); |
| 785 EXPECT_CALL(test_data_.mock_callback_, | 786 EXPECT_CALL(test_data_.mock_callback_, |
| 786 Release(test_data_.mailbox_name1_, _, false)) | 787 Release(test_data_.mailbox_name1_, _, false)) |
| 787 .Times(1); | 788 .Times(1); |
| 788 provider->ReceiveFromParent(list); | 789 ReturnedResourceArray returned; |
| 790 TransferableResource::ReturnResources(list, &returned); |
| 791 provider->ReceiveReturnsFromParent(returned); |
| 789 } | 792 } |
| 790 | 793 |
| 791 // Check that ClearClient correctly clears the state so that the impl side | 794 // Check that ClearClient correctly clears the state so that the impl side |
| 792 // doesn't try to use a texture that could have been destroyed. | 795 // doesn't try to use a texture that could have been destroyed. |
| 793 class TextureLayerClientTest | 796 class TextureLayerClientTest |
| 794 : public LayerTreeTest, | 797 : public LayerTreeTest, |
| 795 public TextureLayerClient { | 798 public TextureLayerClient { |
| 796 public: | 799 public: |
| 797 TextureLayerClientTest() | 800 TextureLayerClientTest() |
| 798 : context_(NULL), | 801 : context_(NULL), |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 int callback_count_; | 1122 int callback_count_; |
| 1120 scoped_refptr<Layer> root_; | 1123 scoped_refptr<Layer> root_; |
| 1121 scoped_refptr<TextureLayer> layer_; | 1124 scoped_refptr<TextureLayer> layer_; |
| 1122 }; | 1125 }; |
| 1123 | 1126 |
| 1124 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1127 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
| 1125 TextureLayerWithMailboxImplThreadDeleted); | 1128 TextureLayerWithMailboxImplThreadDeleted); |
| 1126 | 1129 |
| 1127 } // namespace | 1130 } // namespace |
| 1128 } // namespace cc | 1131 } // namespace cc |
| OLD | NEW |