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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2201853002: Blink handle selection handle visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed incorrect rebase Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 max_page_scale_factor_(0), 75 max_page_scale_factor_(0),
76 device_scale_factor_(1.f), 76 device_scale_factor_(1.f),
77 painted_device_scale_factor_(1.f), 77 painted_device_scale_factor_(1.f),
78 elastic_overscroll_(elastic_overscroll), 78 elastic_overscroll_(elastic_overscroll),
79 layers_(new OwnedLayerImplList), 79 layers_(new OwnedLayerImplList),
80 viewport_size_invalid_(false), 80 viewport_size_invalid_(false),
81 needs_update_draw_properties_(true), 81 needs_update_draw_properties_(true),
82 needs_full_tree_sync_(true), 82 needs_full_tree_sync_(true),
83 next_activation_forces_redraw_(false), 83 next_activation_forces_redraw_(false),
84 has_ever_been_drawn_(false), 84 has_ever_been_drawn_(false),
85 handle_visibility_changed_(false),
85 have_scroll_event_handlers_(false), 86 have_scroll_event_handlers_(false),
86 event_listener_properties_(), 87 event_listener_properties_(),
87 browser_controls_shrink_blink_size_(false), 88 browser_controls_shrink_blink_size_(false),
88 top_controls_height_(0), 89 top_controls_height_(0),
89 bottom_controls_height_(0), 90 bottom_controls_height_(0),
90 top_controls_shown_ratio_(top_controls_shown_ratio) { 91 top_controls_shown_ratio_(top_controls_shown_ratio) {
91 property_trees()->is_main_thread = false; 92 property_trees()->is_main_thread = false;
92 } 93 }
93 94
94 LayerTreeImpl::~LayerTreeImpl() { 95 LayerTreeImpl::~LayerTreeImpl() {
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 bool update_lcd_text = false; 1978 bool update_lcd_text = false;
1978 if (!UpdateDrawProperties(update_lcd_text)) 1979 if (!UpdateDrawProperties(update_lcd_text))
1979 return NULL; 1980 return NULL;
1980 FindTouchEventLayerFunctor func = {screen_space_point}; 1981 FindTouchEventLayerFunctor func = {screen_space_point};
1981 FindClosestMatchingLayerState state; 1982 FindClosestMatchingLayerState state;
1982 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state); 1983 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state);
1983 return state.closest_match; 1984 return state.closest_match;
1984 } 1985 }
1985 1986
1986 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { 1987 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) {
1988 if (selection_ == selection)
1989 return;
1990
1991 handle_visibility_changed_ = true;
1987 selection_ = selection; 1992 selection_ = selection;
1988 } 1993 }
1989 1994
1995 bool LayerTreeImpl::GetAndResetHandleVisibilityChanged() {
1996 bool curr_handle_visibility_changed = handle_visibility_changed_;
1997 handle_visibility_changed_ = false;
1998 return curr_handle_visibility_changed;
1999 }
2000
1990 static gfx::SelectionBound ComputeViewportSelectionBound( 2001 static gfx::SelectionBound ComputeViewportSelectionBound(
1991 const LayerSelectionBound& layer_bound, 2002 const LayerSelectionBound& layer_bound,
1992 LayerImpl* layer, 2003 LayerImpl* layer,
1993 float device_scale_factor) { 2004 float device_scale_factor) {
1994 gfx::SelectionBound viewport_bound; 2005 gfx::SelectionBound viewport_bound;
1995 viewport_bound.set_type(layer_bound.type); 2006 viewport_bound.set_type(layer_bound.type);
1996 2007
1997 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) 2008 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY)
1998 return viewport_bound; 2009 return viewport_bound;
1999 2010
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 2096
2086 void LayerTreeImpl::ResetAllChangeTracking() { 2097 void LayerTreeImpl::ResetAllChangeTracking() {
2087 layers_that_should_push_properties_.clear(); 2098 layers_that_should_push_properties_.clear();
2088 // Iterate over all layers, including masks. 2099 // Iterate over all layers, including masks.
2089 for (auto& layer : *layers_) 2100 for (auto& layer : *layers_)
2090 layer->ResetChangeTracking(); 2101 layer->ResetChangeTracking();
2091 property_trees_.ResetAllChangeTracking(); 2102 property_trees_.ResetAllChangeTracking();
2092 } 2103 }
2093 2104
2094 } // namespace cc 2105 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698