| OLD | NEW |
| 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 Loading... |
| 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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 bool update_lcd_text = false; | 1965 bool update_lcd_text = false; |
| 1965 if (!UpdateDrawProperties(update_lcd_text)) | 1966 if (!UpdateDrawProperties(update_lcd_text)) |
| 1966 return NULL; | 1967 return NULL; |
| 1967 FindTouchEventLayerFunctor func = {screen_space_point}; | 1968 FindTouchEventLayerFunctor func = {screen_space_point}; |
| 1968 FindClosestMatchingLayerState state; | 1969 FindClosestMatchingLayerState state; |
| 1969 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state); | 1970 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state); |
| 1970 return state.closest_match; | 1971 return state.closest_match; |
| 1971 } | 1972 } |
| 1972 | 1973 |
| 1973 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { | 1974 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { |
| 1975 if (selection_ == selection) |
| 1976 return; |
| 1977 |
| 1978 handle_visibility_changed_ = true; |
| 1974 selection_ = selection; | 1979 selection_ = selection; |
| 1975 } | 1980 } |
| 1976 | 1981 |
| 1982 bool LayerTreeImpl::GetAndResetHandleVisibilityChanged() { |
| 1983 bool curr_handle_visibility_changed = handle_visibility_changed_; |
| 1984 handle_visibility_changed_ = false; |
| 1985 return curr_handle_visibility_changed; |
| 1986 } |
| 1987 |
| 1977 static gfx::SelectionBound ComputeViewportSelectionBound( | 1988 static gfx::SelectionBound ComputeViewportSelectionBound( |
| 1978 const LayerSelectionBound& layer_bound, | 1989 const LayerSelectionBound& layer_bound, |
| 1979 LayerImpl* layer, | 1990 LayerImpl* layer, |
| 1980 float device_scale_factor) { | 1991 float device_scale_factor) { |
| 1981 gfx::SelectionBound viewport_bound; | 1992 gfx::SelectionBound viewport_bound; |
| 1982 viewport_bound.set_type(layer_bound.type); | 1993 viewport_bound.set_type(layer_bound.type); |
| 1983 | 1994 |
| 1984 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) | 1995 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) |
| 1985 return viewport_bound; | 1996 return viewport_bound; |
| 1986 | 1997 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2072 | 2083 |
| 2073 void LayerTreeImpl::ResetAllChangeTracking() { | 2084 void LayerTreeImpl::ResetAllChangeTracking() { |
| 2074 layers_that_should_push_properties_.clear(); | 2085 layers_that_should_push_properties_.clear(); |
| 2075 // Iterate over all layers, including masks. | 2086 // Iterate over all layers, including masks. |
| 2076 for (auto& layer : *layers_) | 2087 for (auto& layer : *layers_) |
| 2077 layer->ResetChangeTracking(); | 2088 layer->ResetChangeTracking(); |
| 2078 property_trees_.ResetAllChangeTracking(); | 2089 property_trees_.ResetAllChangeTracking(); |
| 2079 } | 2090 } |
| 2080 | 2091 |
| 2081 } // namespace cc | 2092 } // namespace cc |
| OLD | NEW |