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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 300323005: Route selection bounds updates through the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 7 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
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 5df8fc4ac529125338aad564e79f8ab93e7855aa..2d3a1bbd254b0f0a78f868cba83369c7092d61cf 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -28,6 +28,7 @@
#include "cc/layers/layer_iterator.h"
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/layers/render_surface.h"
+#include "cc/output/selection_handle.h"
#include "cc/resources/prioritized_resource_manager.h"
#include "cc/resources/ui_resource_request.h"
#include "cc/trees/layer_tree_host_client.h"
@@ -328,6 +329,12 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->ClearViewportLayers();
}
+ sync_tree->RegisterSelection(
+ start_selection_layer_ ? start_selection_layer_->id() : 0,
+ start_selection_handle_,
+ end_selection_layer_ ? end_selection_layer_->id() : 0,
+ end_selection_handle_);
+
float page_scale_delta, sent_page_scale_delta;
if (settings_.impl_side_painting) {
// Update the delta from the active tree, which may have
@@ -1246,6 +1253,23 @@ void LayerTreeHost::RegisterViewportLayers(
outer_viewport_scroll_layer_ = outer_viewport_scroll_layer;
}
+void LayerTreeHost::RegisterSelection(scoped_refptr<Layer> start_layer,
+ const SelectionHandle& start_handle,
+ scoped_refptr<Layer> end_layer,
+ const SelectionHandle& end_handle) {
+ if (start_selection_layer_.get() == start_layer.get() &&
+ end_selection_layer_.get() == end_layer.get() &&
+ start_selection_handle_ == start_handle &&
+ end_selection_handle_ == end_handle)
+ return;
+
+ start_selection_layer_ = start_layer;
+ end_selection_layer_ = end_layer;
+ start_selection_handle_ = start_handle;
+ end_selection_handle_ = end_handle;
+ SetNeedsCommit();
+}
+
int LayerTreeHost::ScheduleMicroBenchmark(
const std::string& benchmark_name,
scoped_ptr<base::Value> value,

Powered by Google App Engine
This is Rietveld 408576698