summaryrefslogtreecommitdiffstats
path: root/cc/surfaces/display_unittest.cc
diff options
context:
space:
mode:
authorenne <enne@chromium.org>2016-03-08 16:25:12 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-09 00:26:06 +0000
commit4e3c9d5b507f8a7cfb99ef3cc855184943a1dbd8 (patch)
treee37866af865af000937b9f5e75815883260115e3 /cc/surfaces/display_unittest.cc
parent09361b7a2000298da27d831553547eed54a6f894 (diff)
downloadchromium_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 'cc/surfaces/display_unittest.cc')
-rw-r--r--cc/surfaces/display_unittest.cc26
1 files changed, 1 insertions, 25 deletions
diff --git a/cc/surfaces/display_unittest.cc b/cc/surfaces/display_unittest.cc
index 560e5db..cbc7e34 100644
--- a/cc/surfaces/display_unittest.cc
+++ b/cc/surfaces/display_unittest.cc
@@ -35,8 +35,7 @@ class FakeSurfaceFactoryClient : public SurfaceFactoryClient {
void ReturnResources(const ReturnedResourceArray& resources) override {}
- void SetBeginFrameSource(SurfaceId surface_id,
- BeginFrameSource* begin_frame_source) override {
+ void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override {
begin_frame_source_ = begin_frame_source;
}
@@ -154,29 +153,6 @@ void CopyCallback(bool* called, scoped_ptr<CopyOutputResult> result) {
*called = true;
}
-// Verify Display responds to SurfaceAggregatorClient methods properly.
-TEST_F(DisplayTest, DisplayAsSurfaceAggregatorClient) {
- SetUpContext(nullptr);
- TestDisplayClient client;
- RendererSettings settings;
- Display display(&client, &manager_, shared_bitmap_manager_.get(), nullptr,
- settings);
-
- TestDisplayScheduler scheduler(&display, &fake_begin_frame_source_,
- task_runner_.get());
- display.Initialize(std::move(output_surface_), &scheduler);
-
- SurfaceId surface_id(6);
- factory_.Create(surface_id);
- Surface* surface = manager_.GetSurfaceForId(surface_id);
-
- EXPECT_EQ(nullptr, surface_factory_client_.begin_frame_source());
- display.AddSurface(surface);
- EXPECT_NE(nullptr, surface_factory_client_.begin_frame_source());
- display.RemoveSurface(surface);
- EXPECT_EQ(nullptr, surface_factory_client_.begin_frame_source());
-}
-
// Check that frame is damaged and swapped only under correct conditions.
TEST_F(DisplayTest, DisplayDamaged) {
SetUpContext(nullptr);