| 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 top_controls_shrink_blink_size_(false), | 88 top_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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1963 bool update_lcd_text = false; | 1964 bool update_lcd_text = false; |
| 1964 if (!UpdateDrawProperties(update_lcd_text)) | 1965 if (!UpdateDrawProperties(update_lcd_text)) |
| 1965 return NULL; | 1966 return NULL; |
| 1966 FindTouchEventLayerFunctor func = {screen_space_point}; | 1967 FindTouchEventLayerFunctor func = {screen_space_point}; |
| 1967 FindClosestMatchingLayerState state; | 1968 FindClosestMatchingLayerState state; |
| 1968 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state); | 1969 FindClosestMatchingLayer(screen_space_point, layer_list_[0], func, &state); |
| 1969 return state.closest_match; | 1970 return state.closest_match; |
| 1970 } | 1971 } |
| 1971 | 1972 |
| 1972 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { | 1973 void LayerTreeImpl::RegisterSelection(const LayerSelection& selection) { |
| 1974 if (selection_ == selection) |
| 1975 return; |
| 1976 |
| 1977 handle_visibility_changed_ = true; |
| 1973 selection_ = selection; | 1978 selection_ = selection; |
| 1974 } | 1979 } |
| 1975 | 1980 |
| 1981 bool LayerTreeImpl::GetAndResetHandleVisibilityChanged() { |
| 1982 bool curr_handle_visibility_changed = handle_visibility_changed_; |
| 1983 handle_visibility_changed_ = false; |
| 1984 return curr_handle_visibility_changed; |
| 1985 } |
| 1986 |
| 1976 static gfx::SelectionBound ComputeViewportSelectionBound( | 1987 static gfx::SelectionBound ComputeViewportSelectionBound( |
| 1977 const LayerSelectionBound& layer_bound, | 1988 const LayerSelectionBound& layer_bound, |
| 1978 LayerImpl* layer, | 1989 LayerImpl* layer, |
| 1979 float device_scale_factor) { | 1990 float device_scale_factor) { |
| 1980 gfx::SelectionBound viewport_bound; | 1991 gfx::SelectionBound viewport_bound; |
| 1981 viewport_bound.set_type(layer_bound.type); | 1992 viewport_bound.set_type(layer_bound.type); |
| 1982 | 1993 |
| 1983 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) | 1994 if (!layer || layer_bound.type == gfx::SelectionBound::EMPTY) |
| 1984 return viewport_bound; | 1995 return viewport_bound; |
| 1985 | 1996 |
| (...skipping 86 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 |