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

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: format 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 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 bool update_lcd_text = false; 1977 bool update_lcd_text = false;
1977 if (!UpdateDrawProperties(update_lcd_text)) 1978 if (!UpdateDrawProperties(update_lcd_text))
1978 return NULL; 1979 return NULL;
1979 FindTouchEventLayerFunctor func = {screen_space_point}; 1980 FindTouchEventLayerFunctor func = {screen_space_point};
1980 FindClosestMatchingLayerState state; 1981 FindClosestMatchingLayerState state;
1981 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state); 1982 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state);
1982 return state.closest_match; 1983 return state.closest_match;
1983 } 1984 }
1984 1985
1985 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { 1986 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) {
1987 if (selection_ == selection)
1988 return;
1989
1990 handle_visibility_changed_ = true;
1986 selection_ = selection; 1991 selection_ = selection;
1987 } 1992 }
1988 1993
1994 bool LayerTreeImpl::GetAndResetHandleVisibilityChanged() {
1995 bool curr_handle_visibility_changed = handle_visibility_changed_;
1996 handle_visibility_changed_ = false;
1997 return curr_handle_visibility_changed;
1998 }
1999
1989 static gfx::SelectionBound ComputeViewportSelectionBound( 2000 static gfx::SelectionBound ComputeViewportSelectionBound(
1990 const LayerSelectionBound& layer_bound, 2001 const LayerSelectionBound& layer_bound,
1991 LayerImpl* layer, 2002 LayerImpl* layer,
1992 float device_scale_factor) { 2003 float device_scale_factor) {
1993 gfx::SelectionBound viewport_bound; 2004 gfx::SelectionBound viewport_bound;
1994 viewport_bound.set_type(layer_bound.type); 2005 viewport_bound.set_type(layer_bound.type);
1995 2006
1996 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) 2007 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY)
1997 return viewport_bound; 2008 return viewport_bound;
1998 2009
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 2095
2085 void LayerTreeImpl::ResetAllChangeTracking() { 2096 void LayerTreeImpl::ResetAllChangeTracking() {
2086 layers_that_should_push_properties_.clear(); 2097 layers_that_should_push_properties_.clear();
2087 // Iterate over all layers, including masks. 2098 // Iterate over all layers, including masks.
2088 for (auto& layer : *layers_) 2099 for (auto& layer : *layers_)
2089 layer->ResetChangeTracking(); 2100 layer->ResetChangeTracking();
2090 property_trees_.ResetAllChangeTracking(); 2101 property_trees_.ResetAllChangeTracking();
2091 } 2102 }
2092 2103
2093 } // namespace cc 2104 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698