summaryrefslogtreecommitdiffstats
path: root/android_webview
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 /android_webview
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 'android_webview')
-rw-r--r--android_webview/browser/hardware_renderer.cc6
-rw-r--r--android_webview/browser/hardware_renderer.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc
index 5688b1c..6cb87d8 100644
--- a/android_webview/browser/hardware_renderer.cc
+++ b/android_webview/browser/hardware_renderer.cc
@@ -53,6 +53,9 @@ HardwareRenderer::HardwareRenderer(SharedRendererState* state)
surface_manager_.reset(new cc::SurfaceManager);
surface_id_allocator_.reset(new cc::SurfaceIdAllocator(1));
+ surface_id_allocator_->RegisterSurfaceIdNamespace(surface_manager_.get());
+ surface_manager_->RegisterSurfaceFactoryClient(
+ surface_id_allocator_->id_namespace(), this);
display_.reset(new cc::Display(this, surface_manager_.get(), nullptr, nullptr,
settings));
}
@@ -66,6 +69,8 @@ HardwareRenderer::~HardwareRenderer() {
surface_factory_->Destroy(child_id_);
display_.reset();
surface_factory_.reset();
+ surface_manager_->UnregisterSurfaceFactoryClient(
+ surface_id_allocator_->id_namespace());
// Reset draw constraints.
shared_renderer_state_->PostExternalDrawConstraintsToChildCompositorOnRT(
@@ -222,7 +227,6 @@ void HardwareRenderer::ReturnResources(
}
void HardwareRenderer::SetBeginFrameSource(
- cc::SurfaceId surface_id,
cc::BeginFrameSource* begin_frame_source) {
// TODO(tansell): Hook this up.
}
diff --git a/android_webview/browser/hardware_renderer.h b/android_webview/browser/hardware_renderer.h
index eb1ccc9..a0d3d44 100644
--- a/android_webview/browser/hardware_renderer.h
+++ b/android_webview/browser/hardware_renderer.h
@@ -48,8 +48,7 @@ class HardwareRenderer : public cc::DisplayClient,
// cc::SurfaceFactoryClient implementation.
void ReturnResources(const cc::ReturnedResourceArray& resources) override;
- void SetBeginFrameSource(cc::SurfaceId surface_id,
- cc::BeginFrameSource* begin_frame_source) override;
+ void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
void ReturnResourcesInChildFrame();
void ReturnResourcesToCompositor(const cc::ReturnedResourceArray& resources,