Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 settings.single_thread_proxy_scheduler = false; 1964 settings.single_thread_proxy_scheduler = false;
1965 1965
1966 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( 1966 scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
1967 new TestSharedBitmapManager()); 1967 new TestSharedBitmapManager());
1968 scoped_ptr<LayerTreeHost> host = 1968 scoped_ptr<LayerTreeHost> host =
1969 LayerTreeHost::CreateSingleThreaded(&client, 1969 LayerTreeHost::CreateSingleThreaded(&client,
1970 &client, 1970 &client,
1971 shared_bitmap_manager.get(), 1971 shared_bitmap_manager.get(),
1972 NULL, 1972 NULL,
1973 settings, 1973 settings,
1974 base::MessageLoopProxy::current()); 1974 base::MessageLoopProxy::current(),
1975 nullptr);
1975 client.SetLayerTreeHost(host.get()); 1976 client.SetLayerTreeHost(host.get());
1976 host->Composite(base::TimeTicks::Now()); 1977 host->Composite(base::TimeTicks::Now());
1977 1978
1978 EXPECT_EQ(4u, host->settings().max_partial_texture_updates); 1979 EXPECT_EQ(4u, host->settings().max_partial_texture_updates);
1979 } 1980 }
1980 1981
1981 TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) { 1982 TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) {
1982 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_SOFTWARE); 1983 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_SOFTWARE);
1983 1984
1984 LayerTreeSettings settings; 1985 LayerTreeSettings settings;
1985 settings.max_partial_texture_updates = 4; 1986 settings.max_partial_texture_updates = 4;
1986 settings.single_thread_proxy_scheduler = false; 1987 settings.single_thread_proxy_scheduler = false;
1987 1988
1988 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( 1989 scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
1989 new TestSharedBitmapManager()); 1990 new TestSharedBitmapManager());
1990 scoped_ptr<LayerTreeHost> host = 1991 scoped_ptr<LayerTreeHost> host =
1991 LayerTreeHost::CreateSingleThreaded(&client, 1992 LayerTreeHost::CreateSingleThreaded(&client,
1992 &client, 1993 &client,
1993 shared_bitmap_manager.get(), 1994 shared_bitmap_manager.get(),
1994 NULL, 1995 NULL,
1995 settings, 1996 settings,
1996 base::MessageLoopProxy::current()); 1997 base::MessageLoopProxy::current(),
1998 nullptr);
1997 client.SetLayerTreeHost(host.get()); 1999 client.SetLayerTreeHost(host.get());
1998 host->Composite(base::TimeTicks::Now()); 2000 host->Composite(base::TimeTicks::Now());
1999 2001
2000 EXPECT_EQ(4u, host->settings().max_partial_texture_updates); 2002 EXPECT_EQ(4u, host->settings().max_partial_texture_updates);
2001 } 2003 }
2002 2004
2003 TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) { 2005 TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) {
2004 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DELEGATED_3D); 2006 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DELEGATED_3D);
2005 2007
2006 LayerTreeSettings settings; 2008 LayerTreeSettings settings;
2007 settings.max_partial_texture_updates = 4; 2009 settings.max_partial_texture_updates = 4;
2008 settings.single_thread_proxy_scheduler = false; 2010 settings.single_thread_proxy_scheduler = false;
2009 2011
2010 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( 2012 scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
2011 new TestSharedBitmapManager()); 2013 new TestSharedBitmapManager());
2012 scoped_ptr<LayerTreeHost> host = 2014 scoped_ptr<LayerTreeHost> host =
2013 LayerTreeHost::CreateSingleThreaded(&client, 2015 LayerTreeHost::CreateSingleThreaded(&client,
2014 &client, 2016 &client,
2015 shared_bitmap_manager.get(), 2017 shared_bitmap_manager.get(),
2016 NULL, 2018 NULL,
2017 settings, 2019 settings,
2018 base::MessageLoopProxy::current()); 2020 base::MessageLoopProxy::current(),
2021 nullptr);
2019 client.SetLayerTreeHost(host.get()); 2022 client.SetLayerTreeHost(host.get());
2020 host->Composite(base::TimeTicks::Now()); 2023 host->Composite(base::TimeTicks::Now());
2021 2024
2022 EXPECT_EQ(0u, host->MaxPartialTextureUpdates()); 2025 EXPECT_EQ(0u, host->MaxPartialTextureUpdates());
2023 } 2026 }
2024 2027
2025 TEST(LayerTreeHostTest, 2028 TEST(LayerTreeHostTest,
2026 PartialUpdatesWithDelegatingRendererAndSoftwareContent) { 2029 PartialUpdatesWithDelegatingRendererAndSoftwareContent) {
2027 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DELEGATED_SOFTWARE); 2030 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DELEGATED_SOFTWARE);
2028 2031
2029 LayerTreeSettings settings; 2032 LayerTreeSettings settings;
2030 settings.max_partial_texture_updates = 4; 2033 settings.max_partial_texture_updates = 4;
2031 settings.single_thread_proxy_scheduler = false; 2034 settings.single_thread_proxy_scheduler = false;
2032 2035
2033 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( 2036 scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
2034 new TestSharedBitmapManager()); 2037 new TestSharedBitmapManager());
2035 scoped_ptr<LayerTreeHost> host = 2038 scoped_ptr<LayerTreeHost> host =
2036 LayerTreeHost::CreateSingleThreaded(&client, 2039 LayerTreeHost::CreateSingleThreaded(&client,
2037 &client, 2040 &client,
2038 shared_bitmap_manager.get(), 2041 shared_bitmap_manager.get(),
2039 NULL, 2042 NULL,
2040 settings, 2043 settings,
2041 base::MessageLoopProxy::current()); 2044 base::MessageLoopProxy::current(),
2045 nullptr);
2042 client.SetLayerTreeHost(host.get()); 2046 client.SetLayerTreeHost(host.get());
2043 host->Composite(base::TimeTicks::Now()); 2047 host->Composite(base::TimeTicks::Now());
2044 2048
2045 EXPECT_EQ(0u, host->MaxPartialTextureUpdates()); 2049 EXPECT_EQ(0u, host->MaxPartialTextureUpdates());
2046 } 2050 }
2047 2051
2048 class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted 2052 class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
2049 : public LayerTreeHostTest { 2053 : public LayerTreeHostTest {
2050 public: 2054 public:
2051 LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted() 2055 LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted()
(...skipping 3147 matching lines...) Expand 10 before | Expand all | Expand 10 after
5199 void AfterTest() override { 5203 void AfterTest() override {
5200 EXPECT_TRUE(deltas_sent_to_client_); 5204 EXPECT_TRUE(deltas_sent_to_client_);
5201 } 5205 }
5202 5206
5203 ScrollAndScaleSet info_; 5207 ScrollAndScaleSet info_;
5204 bool deltas_sent_to_client_; 5208 bool deltas_sent_to_client_;
5205 }; 5209 };
5206 5210
5207 MULTI_THREAD_TEST_F(LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer); 5211 MULTI_THREAD_TEST_F(LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer);
5208 } // namespace cc 5212 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698