diff options
author | enne <enne@chromium.org> | 2016-03-08 16:25:12 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-09 00:26:06 +0000 |
commit | 4e3c9d5b507f8a7cfb99ef3cc855184943a1dbd8 (patch) | |
tree | e37866af865af000937b9f5e75815883260115e3 /components/mus/ws/window_tree_unittest.cc | |
parent | 09361b7a2000298da27d831553547eed54a6f894 (diff) | |
download | chromium_src-4e3c9d5b507f8a7cfb99ef3cc855184943a1dbd8.zip chromium_src-4e3c9d5b507f8a7cfb99ef3cc855184943a1dbd8.tar.gz chromium_src-4e3c9d5b507f8a7cfb99ef3cc855184943a1dbd8.tar.bz2 |
Hook up BeginFrameSource to SurfaceFactoryClient via SurfaceManager
SurfaceManager now maintains a dag of surface id namespaces.
Optionally, a single BeginFrameSource input can be attached to a single
namespace node. Every namespace node also has a SurfaceFactoryClient.
This client is informed of a current BeginFrameSource, which is chosen
from any BeginFrameSource attached to it or a parent of that node.
Any children of that namespace also are able to use that source.
SurfaceManager is responsible for picking which source to use, of which
it currently just picks the first one until that source goes is removed
after which it arbitrarily picks another valid one. In practice, this
means that a window moved to another display in ChromeOS will switch its
BeginFrameSource after the window is dropped onto the new window.
Because the users of this dag all have very different requirements, the
ordering of SurfaceFactoryClient registration, namespace hierarchy
registration, and BeginFrameSource attaching are not particularly
strict. BeginFrameSources, SurfaceFactoryClients, and hierarchies can
be registered and unregistered in any order with respect to each other.
BUG=401331
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1673783004
Cr-Commit-Position: refs/heads/master@{#379988}
Diffstat (limited to 'components/mus/ws/window_tree_unittest.cc')
-rw-r--r-- | components/mus/ws/window_tree_unittest.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/components/mus/ws/window_tree_unittest.cc b/components/mus/ws/window_tree_unittest.cc index 17f59eb..e0b5eb1 100644 --- a/components/mus/ws/window_tree_unittest.cc +++ b/components/mus/ws/window_tree_unittest.cc @@ -163,7 +163,8 @@ class WindowTreeTest : public testing::Test { WindowTreeTest() : wm_client_(nullptr), cursor_id_(0), - platform_display_factory_(&cursor_id_) {} + platform_display_factory_(&cursor_id_), + surfaces_state_(new SurfacesState()) {} ~WindowTreeTest() override {} // WindowTree for the window manager. @@ -217,10 +218,10 @@ class WindowTreeTest : public testing::Test { void SetUp() override { PlatformDisplay::set_factory_for_testing(&platform_display_factory_); connection_manager_.reset( - new ConnectionManager(&delegate_, scoped_refptr<SurfacesState>())); + new ConnectionManager(&delegate_, surfaces_state_)); display_ = new Display(connection_manager_.get(), nullptr, scoped_refptr<GpuState>(), - scoped_refptr<mus::SurfacesState>()); + surfaces_state_); display_binding_ = new TestDisplayBinding(display_, connection_manager_.get()); display_->Init(make_scoped_ptr(display_binding_)); @@ -236,6 +237,7 @@ class WindowTreeTest : public testing::Test { // Owned by ConnectionManager. TestDisplayBinding* display_binding_; Display* display_ = nullptr; + scoped_refptr<SurfacesState> surfaces_state_; scoped_ptr<ConnectionManager> connection_manager_; base::MessageLoop message_loop_; |