| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2239 compositor_mutable_properties; | 2239 compositor_mutable_properties; |
| 2240 scroll_mutable_properties = (CompositorMutableProperty::kScrollLeft | | 2240 scroll_mutable_properties = (CompositorMutableProperty::kScrollLeft | |
| 2241 CompositorMutableProperty::kScrollTop) & | 2241 CompositorMutableProperty::kScrollTop) & |
| 2242 compositor_mutable_properties; | 2242 compositor_mutable_properties; |
| 2243 } | 2243 } |
| 2244 | 2244 |
| 2245 if (animating_style && animating_style->ShouldCompositeForCurrentAnimations()) | 2245 if (animating_style && animating_style->ShouldCompositeForCurrentAnimations()) |
| 2246 element_id = DOMNodeIds::IdForNode(owning_node); | 2246 element_id = DOMNodeIds::IdForNode(owning_node); |
| 2247 | 2247 |
| 2248 CompositorElementId compositor_element_id; | 2248 CompositorElementId compositor_element_id; |
| 2249 if (element_id) | 2249 if (element_id) { |
| 2250 compositor_element_id = | 2250 compositor_element_id = CompositorElementIdFromDOMNodeId( |
| 2251 CreateCompositorElementId(element_id, CompositorSubElementId::kPrimary); | 2251 element_id, CompositorElementIdNamespace::kPrimary); |
| 2252 } |
| 2252 | 2253 |
| 2253 graphics_layer_->SetElementId(compositor_element_id); | 2254 graphics_layer_->SetElementId(compositor_element_id); |
| 2254 graphics_layer_->SetCompositorMutableProperties(primary_mutable_properties); | 2255 graphics_layer_->SetCompositorMutableProperties(primary_mutable_properties); |
| 2255 | 2256 |
| 2256 // We always set the elementId for m_scrollingContentsLayer since it can be | 2257 // We always set the elementId for m_scrollingContentsLayer since it can be |
| 2257 // animated for smooth scrolling, so we don't need to set it conditionally | 2258 // animated for smooth scrolling, so we don't need to set it conditionally |
| 2258 // here. | 2259 // here. |
| 2259 if (scrolling_contents_layer_.get()) | 2260 if (scrolling_contents_layer_.get()) |
| 2260 scrolling_contents_layer_->SetCompositorMutableProperties( | 2261 scrolling_contents_layer_->SetCompositorMutableProperties( |
| 2261 scroll_mutable_properties); | 2262 scroll_mutable_properties); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2365 // Outer layer which corresponds with the scroll view. | 2366 // Outer layer which corresponds with the scroll view. |
| 2366 scrolling_layer_ = | 2367 scrolling_layer_ = |
| 2367 CreateGraphicsLayer(kCompositingReasonLayerForScrollingContainer); | 2368 CreateGraphicsLayer(kCompositingReasonLayerForScrollingContainer); |
| 2368 scrolling_layer_->SetDrawsContent(false); | 2369 scrolling_layer_->SetDrawsContent(false); |
| 2369 scrolling_layer_->SetMasksToBounds(true); | 2370 scrolling_layer_->SetMasksToBounds(true); |
| 2370 | 2371 |
| 2371 // Inner layer which renders the content that scrolls. | 2372 // Inner layer which renders the content that scrolls. |
| 2372 scrolling_contents_layer_ = | 2373 scrolling_contents_layer_ = |
| 2373 CreateGraphicsLayer(kCompositingReasonLayerForScrollingContents); | 2374 CreateGraphicsLayer(kCompositingReasonLayerForScrollingContents); |
| 2374 | 2375 |
| 2375 if (Node* owning_node = owning_layer_.GetLayoutObject().GetNode()) | 2376 if (Node* owning_node = owning_layer_.GetLayoutObject().GetNode()) { |
| 2376 scrolling_contents_layer_->SetElementId( | 2377 scrolling_contents_layer_->SetElementId( |
| 2377 CreateCompositorElementId(DOMNodeIds::IdForNode(owning_node), | 2378 CompositorElementIdFromDOMNodeId( |
| 2378 CompositorSubElementId::kScroll)); | 2379 DOMNodeIds::IdForNode(owning_node), |
| 2380 CompositorElementIdNamespace::kScroll)); |
| 2381 } |
| 2379 | 2382 |
| 2380 scrolling_layer_->AddChild(scrolling_contents_layer_.get()); | 2383 scrolling_layer_->AddChild(scrolling_contents_layer_.get()); |
| 2381 | 2384 |
| 2382 layer_changed = true; | 2385 layer_changed = true; |
| 2383 if (scrolling_coordinator) { | 2386 if (scrolling_coordinator) { |
| 2384 scrolling_coordinator->ScrollableAreaScrollLayerDidChange( | 2387 scrolling_coordinator->ScrollableAreaScrollLayerDidChange( |
| 2385 owning_layer_.GetScrollableArea()); | 2388 owning_layer_.GetScrollableArea()); |
| 2386 scrolling_coordinator->ScrollableAreasDidChange(); | 2389 scrolling_coordinator->ScrollableAreasDidChange(); |
| 2387 } | 2390 } |
| 2388 } | 2391 } |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3621 } else if (graphics_layer == decoration_outline_layer_.get()) { | 3624 } else if (graphics_layer == decoration_outline_layer_.get()) { |
| 3622 name = "Decoration Layer"; | 3625 name = "Decoration Layer"; |
| 3623 } else { | 3626 } else { |
| 3624 NOTREACHED(); | 3627 NOTREACHED(); |
| 3625 } | 3628 } |
| 3626 | 3629 |
| 3627 return name; | 3630 return name; |
| 3628 } | 3631 } |
| 3629 | 3632 |
| 3630 } // namespace blink | 3633 } // namespace blink |
| OLD | NEW |