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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1602343002: compositor-worker: cc->blink mutation plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-ian-patch
Patch Set: Merge master + s/scoped_ptr/unique_ptr/ Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/proxy_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 651fe18ef032309174721e5c9aa0084f21937a26..d491ec6d36a47e1e095c6b460bcf413a9c9612a9 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -15,6 +15,7 @@
#include <utility>
#include "base/auto_reset.h"
+#include "base/bind.h"
#include "base/containers/small_map.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
@@ -25,6 +26,8 @@
#include "base/trace_event/trace_event_argument.h"
#include "cc/animation/animation_events.h"
#include "cc/animation/animation_host.h"
+#include "cc/animation/animation_id_provider.h"
+#include "cc/animation/scroll_offset_animation_curve.h"
#include "cc/animation/timing_function.h"
#include "cc/base/histograms.h"
#include "cc/base/math_util.h"
@@ -237,7 +240,8 @@ LayerTreeHostImpl::LayerTreeHostImpl(
id_(id),
requires_high_res_to_draw_(false),
is_likely_to_require_a_draw_(false),
- frame_timing_tracker_(FrameTimingTracker::Create(this)) {
+ frame_timing_tracker_(FrameTimingTracker::Create(this)),
+ mutator_(nullptr) {
animation_host_ = AnimationHost::Create(ThreadInstance::IMPL);
animation_host_->SetMutatorHostClient(this);
animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling());
@@ -2254,6 +2258,12 @@ void LayerTreeHostImpl::PostFrameTimingEvents(
std::move(main_frame_events));
}
+void LayerTreeHostImpl::SetLayerTreeMutator(LayerTreeMutator* mutator) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "LayerTreeHostImpl::SetLayerTreeMutator");
+ mutator_ = mutator;
+}
+
void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
ClearUIResources();
tile_manager_->FinishTasksAndCleanUp();
@@ -3310,6 +3320,17 @@ void LayerTreeHostImpl::PinchGestureEnd() {
SetNeedsRedraw();
}
+std::unique_ptr<BeginFrameCallbackList>
+LayerTreeHostImpl::ProcessLayerTreeMutations() {
+ auto callbacks = make_scoped_ptr(new BeginFrameCallbackList());
+ if (mutator_) {
+ const base::Closure& callback = mutator_->TakeMutations();
+ if (!callback.is_null())
+ callbacks->push_back(callback);
+ }
+ return callbacks;
+}
+
static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
LayerImpl* root_layer) {
if (!root_layer)
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/proxy_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698