OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 #endif | 1196 #endif |
1197 | 1197 |
1198 layer->SetTransformTreeIndex(transform_tree_index()); | 1198 layer->SetTransformTreeIndex(transform_tree_index()); |
1199 layer->SetEffectTreeIndex(effect_tree_index()); | 1199 layer->SetEffectTreeIndex(effect_tree_index()); |
1200 layer->SetClipTreeIndex(clip_tree_index()); | 1200 layer->SetClipTreeIndex(clip_tree_index()); |
1201 layer->set_offset_to_transform_parent(offset_to_transform_parent_); | 1201 layer->set_offset_to_transform_parent(offset_to_transform_parent_); |
1202 layer->SetDoubleSided(double_sided_); | 1202 layer->SetDoubleSided(double_sided_); |
1203 layer->SetDrawsContent(DrawsContent()); | 1203 layer->SetDrawsContent(DrawsContent()); |
1204 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); | 1204 layer->SetHideLayerAndSubtree(hide_layer_and_subtree_); |
1205 layer->SetHasRenderSurface(has_render_surface_); | 1205 layer->SetHasRenderSurface(has_render_surface_); |
| 1206 layer->SetForceRenderSurface(force_render_surface_); |
1206 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) | 1207 if (!layer->FilterIsAnimatingOnImplOnly() && !FilterIsAnimating()) |
1207 layer->SetFilters(filters_); | 1208 layer->SetFilters(filters_); |
1208 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); | 1209 DCHECK(!(FilterIsAnimating() && layer->FilterIsAnimatingOnImplOnly())); |
1209 layer->SetBackgroundFilters(background_filters()); | 1210 layer->SetBackgroundFilters(background_filters()); |
1210 layer->SetMasksToBounds(masks_to_bounds_); | 1211 layer->SetMasksToBounds(masks_to_bounds_); |
1211 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); | 1212 layer->SetShouldScrollOnMainThread(should_scroll_on_main_thread_); |
1212 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); | 1213 layer->SetHaveWheelEventHandlers(have_wheel_event_handlers_); |
1213 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); | 1214 layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_); |
1214 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); | 1215 layer->SetNonFastScrollableRegion(non_fast_scrollable_region_); |
1215 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); | 1216 layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 return client_->TakeDebugInfo(this); | 1535 return client_->TakeDebugInfo(this); |
1535 else | 1536 else |
1536 return nullptr; | 1537 return nullptr; |
1537 } | 1538 } |
1538 | 1539 |
1539 void Layer::SetHasRenderSurface(bool has_render_surface) { | 1540 void Layer::SetHasRenderSurface(bool has_render_surface) { |
1540 if (has_render_surface_ == has_render_surface) | 1541 if (has_render_surface_ == has_render_surface) |
1541 return; | 1542 return; |
1542 has_render_surface_ = has_render_surface; | 1543 has_render_surface_ = has_render_surface; |
1543 // We do not need SetNeedsCommit here, since this is only ever called | 1544 // We do not need SetNeedsCommit here, since this is only ever called |
1544 // during a commit, from CalculateDrawProperties. | 1545 // during a commit, from CalculateDrawProperties using property trees. |
1545 SetNeedsPushProperties(); | 1546 SetNeedsPushProperties(); |
1546 layer_tree_host_->property_trees()->needs_rebuild = true; | |
1547 } | 1547 } |
1548 | 1548 |
1549 gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const { | 1549 gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const { |
1550 return CurrentScrollOffset(); | 1550 return CurrentScrollOffset(); |
1551 } | 1551 } |
1552 | 1552 |
1553 // On<Property>Animated is called due to an ongoing accelerated animation. | 1553 // On<Property>Animated is called due to an ongoing accelerated animation. |
1554 // Since this animation is also being run on the compositor thread, there | 1554 // Since this animation is also being run on the compositor thread, there |
1555 // is no need to request a commit to push this value over, so the value is | 1555 // is no need to request a commit to push this value over, so the value is |
1556 // set directly rather than by calling Set<Property>. | 1556 // set directly rather than by calling Set<Property>. |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 this, layer_tree_host_->property_trees()->transform_tree); | 1826 this, layer_tree_host_->property_trees()->transform_tree); |
1827 } | 1827 } |
1828 | 1828 |
1829 gfx::Transform Layer::screen_space_transform() const { | 1829 gfx::Transform Layer::screen_space_transform() const { |
1830 DCHECK_NE(transform_tree_index_, -1); | 1830 DCHECK_NE(transform_tree_index_, -1); |
1831 return ScreenSpaceTransformFromPropertyTrees( | 1831 return ScreenSpaceTransformFromPropertyTrees( |
1832 this, layer_tree_host_->property_trees()->transform_tree); | 1832 this, layer_tree_host_->property_trees()->transform_tree); |
1833 } | 1833 } |
1834 | 1834 |
1835 } // namespace cc | 1835 } // namespace cc |
OLD | NEW |