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

Unified Diff: cc/test/layer_tree_host_remote_for_testing.cc

Issue 2404953002: cc/blimp: Set up hooks for scroll/scale sync. (Closed)
Patch Set: braces Created 4 years, 2 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/test/layer_tree_host_remote_for_testing.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_host_remote_for_testing.cc
diff --git a/cc/test/layer_tree_host_remote_for_testing.cc b/cc/test/layer_tree_host_remote_for_testing.cc
index ff877df326e317c68448de0f5060a0f50ee252a1..25dc9e571d9935c9825ca2928e74bf96a45f17d0 100644
--- a/cc/test/layer_tree_host_remote_for_testing.cc
+++ b/cc/test/layer_tree_host_remote_for_testing.cc
@@ -9,6 +9,7 @@
#include "cc/blimp/compositor_proto_state.h"
#include "cc/blimp/compositor_state_deserializer.h"
#include "cc/blimp/remote_compositor_bridge.h"
+#include "cc/layers/layer.h"
#include "cc/proto/compositor_message.pb.h"
#include "cc/test/fake_image_serialization_processor.h"
#include "cc/test/remote_client_layer_factory.h"
@@ -61,6 +62,8 @@ class LayerTreeHostRemoteForTesting::LayerTreeHostInProcessClient
void WillBeginMainFrame() override {}
void BeginMainFrame(const BeginFrameArgs& args) override {
+ // Send any scroll/scale updates first.
+ layer_tree_host_remote_->ApplyUpdatesFromInProcessHost();
layer_tree_host_remote_->BeginMainFrame();
}
void BeginMainFrameNotExpectedSoon() override {}
@@ -72,9 +75,7 @@ class LayerTreeHostRemoteForTesting::LayerTreeHostInProcessClient
const gfx::Vector2dF& outer_delta,
const gfx::Vector2dF& elastic_overscroll_delta,
float page_scale,
- float top_controls_delta) override {
- // TODO(khushalsagar): Hook up when scroll/scale sync is added.
- }
+ float top_controls_delta) override {}
void RequestNewCompositorFrameSink() override {
layer_tree_host_remote_->client()->RequestNewCompositorFrameSink();
}
@@ -276,7 +277,16 @@ bool LayerTreeHostRemoteForTesting::ShouldRetainClientPageScale(
}
void LayerTreeHostRemoteForTesting::LayerDidScroll(int engine_layer_id) {
- // TODO(khushalsagar): Hook up when scroll/scale sync is added.
+ layers_scrolled_[engine_layer_id] =
+ compositor_state_deserializer_->GetLayerForEngineId(engine_layer_id)
+ ->scroll_offset();
+}
+
+void LayerTreeHostRemoteForTesting::ApplyUpdatesFromInProcessHost() {
+ ApplyScrollAndScaleUpdateFromClient(
+ layers_scrolled_,
+ layer_tree_host_in_process_->GetLayerTree()->page_scale_factor());
+ layers_scrolled_.clear();
}
void LayerTreeHostRemoteForTesting::RemoteHostNeedsMainFrame() {
« no previous file with comments | « cc/test/layer_tree_host_remote_for_testing.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698