Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 #include "cc/layers/texture_layer_client.h" | 26 #include "cc/layers/texture_layer_client.h" |
| 27 #include "cc/layers/texture_layer_impl.h" | 27 #include "cc/layers/texture_layer_impl.h" |
| 28 #include "cc/output/context_provider.h" | 28 #include "cc/output/context_provider.h" |
| 29 #include "cc/resources/returned_resource.h" | 29 #include "cc/resources/returned_resource.h" |
| 30 #include "cc/test/fake_impl_task_runner_provider.h" | 30 #include "cc/test/fake_impl_task_runner_provider.h" |
| 31 #include "cc/test/fake_layer_tree_host_client.h" | 31 #include "cc/test/fake_layer_tree_host_client.h" |
| 32 #include "cc/test/fake_layer_tree_host_impl.h" | 32 #include "cc/test/fake_layer_tree_host_impl.h" |
| 33 #include "cc/test/fake_output_surface.h" | 33 #include "cc/test/fake_output_surface.h" |
| 34 #include "cc/test/layer_test_common.h" | 34 #include "cc/test/layer_test_common.h" |
| 35 #include "cc/test/layer_tree_test.h" | 35 #include "cc/test/layer_tree_test.h" |
| 36 #include "cc/test/stub_layer_tree_host_single_thread_client.h" | |
| 36 #include "cc/test/test_task_graph_runner.h" | 37 #include "cc/test/test_task_graph_runner.h" |
| 37 #include "cc/test/test_web_graphics_context_3d.h" | 38 #include "cc/test/test_web_graphics_context_3d.h" |
| 38 #include "cc/trees/blocking_task_runner.h" | 39 #include "cc/trees/blocking_task_runner.h" |
| 39 #include "cc/trees/layer_tree_host.h" | 40 #include "cc/trees/layer_tree_host.h" |
| 40 #include "cc/trees/layer_tree_impl.h" | 41 #include "cc/trees/layer_tree_impl.h" |
| 41 #include "cc/trees/single_thread_proxy.h" | 42 #include "cc/trees/single_thread_proxy.h" |
| 42 #include "gpu/GLES2/gl2extchromium.h" | 43 #include "gpu/GLES2/gl2extchromium.h" |
| 43 #include "testing/gmock/include/gmock/gmock.h" | 44 #include "testing/gmock/include/gmock/gmock.h" |
| 44 #include "testing/gtest/include/gtest/gtest.h" | 45 #include "testing/gtest/include/gtest/gtest.h" |
| 45 | 46 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 params.settings = &settings; | 78 params.settings = &settings; |
| 78 return base::WrapUnique(new MockLayerTreeHost(client, ¶ms)); | 79 return base::WrapUnique(new MockLayerTreeHost(client, ¶ms)); |
| 79 } | 80 } |
| 80 | 81 |
| 81 MOCK_METHOD0(SetNeedsCommit, void()); | 82 MOCK_METHOD0(SetNeedsCommit, void()); |
| 82 MOCK_METHOD0(SetNeedsUpdateLayers, void()); | 83 MOCK_METHOD0(SetNeedsUpdateLayers, void()); |
| 83 MOCK_METHOD0(StartRateLimiter, void()); | 84 MOCK_METHOD0(StartRateLimiter, void()); |
| 84 MOCK_METHOD0(StopRateLimiter, void()); | 85 MOCK_METHOD0(StopRateLimiter, void()); |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 MockLayerTreeHost(FakeLayerTreeHostClient* client, | 88 MockLayerTreeHost(FakeLayerTreeHostClient* client, |
|
vmpstr
2016/07/22 21:08:43
not used anymore?
danakj
2016/07/22 21:21:20
Done.
| |
| 88 LayerTreeHost::InitParams* params) | 89 LayerTreeHost::InitParams* params) |
| 89 : LayerTreeHost(params, CompositorMode::SINGLE_THREADED) { | 90 : LayerTreeHost(params, CompositorMode::SINGLE_THREADED) { |
| 90 InitializeSingleThreaded(client, base::ThreadTaskRunnerHandle::Get(), | 91 InitializeSingleThreaded(&single_thread_client_, |
| 91 nullptr); | 92 base::ThreadTaskRunnerHandle::Get(), nullptr); |
| 92 } | 93 } |
| 94 | |
| 95 StubLayerTreeHostSingleThreadClient single_thread_client_; | |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 class FakeTextureLayerClient : public TextureLayerClient { | 98 class FakeTextureLayerClient : public TextureLayerClient { |
| 96 public: | 99 public: |
| 97 FakeTextureLayerClient() : mailbox_changed_(true) {} | 100 FakeTextureLayerClient() : mailbox_changed_(true) {} |
| 98 | 101 |
| 99 bool PrepareTextureMailbox( | 102 bool PrepareTextureMailbox( |
| 100 TextureMailbox* mailbox, | 103 TextureMailbox* mailbox, |
| 101 std::unique_ptr<SingleReleaseCallback>* release_callback, | 104 std::unique_ptr<SingleReleaseCallback>* release_callback, |
| 102 bool use_shared_memory) override { | 105 bool use_shared_memory) override { |
| (...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1445 int callback_count_; | 1448 int callback_count_; |
| 1446 scoped_refptr<Layer> root_; | 1449 scoped_refptr<Layer> root_; |
| 1447 scoped_refptr<TextureLayer> layer_; | 1450 scoped_refptr<TextureLayer> layer_; |
| 1448 }; | 1451 }; |
| 1449 | 1452 |
| 1450 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1453 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
| 1451 TextureLayerWithMailboxImplThreadDeleted); | 1454 TextureLayerWithMailboxImplThreadDeleted); |
| 1452 | 1455 |
| 1453 } // namespace | 1456 } // namespace |
| 1454 } // namespace cc | 1457 } // namespace cc |
| OLD | NEW |