OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 if (layersChanged) { | 401 if (layersChanged) { |
402 updateType = std::max(updateType, CompositingUpdateRebuildTree); | 402 updateType = std::max(updateType, CompositingUpdateRebuildTree); |
403 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoor
dinator()) | 403 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoor
dinator()) |
404 scrollingCoordinator->notifyGeometryChanged(); | 404 scrollingCoordinator->notifyGeometryChanged(); |
405 } | 405 } |
406 } | 406 } |
407 | 407 |
408 if (updateType != CompositingUpdateNone) { | 408 if (updateType != CompositingUpdateNone) { |
409 if (RuntimeEnabledFeatures::compositorWorkerEnabled() && m_scrollLayer)
{ | 409 if (RuntimeEnabledFeatures::compositorWorkerEnabled() && m_scrollLayer)
{ |
410 LocalFrame* frame = m_layoutView.document().frame(); | |
411 Settings* settings = frame ? frame->settings() : nullptr; | |
412 // If rootLayerScrolls is enabled, these properties are applied in | 410 // If rootLayerScrolls is enabled, these properties are applied in |
413 // CompositedLayerMapping::updateElementIdAndCompositorMutableProper
ties. | 411 // CompositedLayerMapping::updateElementIdAndCompositorMutableProper
ties. |
414 if (!settings || !settings->rootLayerScrolls()) { | 412 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
415 if (Element* scrollingElement = m_layoutView.document().scrollin
gElement()) { | 413 if (Element* scrollingElement = m_layoutView.document().scrollin
gElement()) { |
416 uint32_t mutableProperties = CompositorMutableProperty::kNon
e; | 414 uint32_t mutableProperties = CompositorMutableProperty::kNon
e; |
417 if (scrollingElement->hasCompositorProxy()) | 415 if (scrollingElement->hasCompositorProxy()) |
418 mutableProperties = (CompositorMutableProperty::kScrollL
eft | CompositorMutableProperty::kScrollTop) & scrollingElement->compositorMutab
leProperties(); | 416 mutableProperties = (CompositorMutableProperty::kScrollL
eft | CompositorMutableProperty::kScrollTop) & scrollingElement->compositorMutab
leProperties(); |
419 m_scrollLayer->setCompositorMutableProperties(mutablePropert
ies); | 417 m_scrollLayer->setCompositorMutableProperties(mutablePropert
ies); |
420 } | 418 } |
421 } | 419 } |
422 } | 420 } |
423 | 421 |
424 GraphicsLayerUpdater updater; | 422 GraphicsLayerUpdater updater; |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 | 1011 |
1014 m_layoutView.frameView()->positionScrollbarLayers(); | 1012 m_layoutView.frameView()->positionScrollbarLayers(); |
1015 } | 1013 } |
1016 | 1014 |
1017 void PaintLayerCompositor::ensureRootLayer() | 1015 void PaintLayerCompositor::ensureRootLayer() |
1018 { | 1016 { |
1019 RootLayerAttachment expectedAttachment = m_layoutView.frame()->isLocalRoot()
? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame; | 1017 RootLayerAttachment expectedAttachment = m_layoutView.frame()->isLocalRoot()
? RootLayerAttachedViaChromeClient : RootLayerAttachedViaEnclosingFrame; |
1020 if (expectedAttachment == m_rootLayerAttachment) | 1018 if (expectedAttachment == m_rootLayerAttachment) |
1021 return; | 1019 return; |
1022 | 1020 |
1023 Settings* settings = m_layoutView.document().settings(); | |
1024 if (!m_rootContentLayer) { | 1021 if (!m_rootContentLayer) { |
1025 m_rootContentLayer = GraphicsLayer::create(this); | 1022 m_rootContentLayer = GraphicsLayer::create(this); |
1026 IntRect overflowRect = m_layoutView.pixelSnappedLayoutOverflowRect(); | 1023 IntRect overflowRect = m_layoutView.pixelSnappedLayoutOverflowRect(); |
1027 m_rootContentLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.
maxY())); | 1024 m_rootContentLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.
maxY())); |
1028 m_rootContentLayer->setPosition(FloatPoint()); | 1025 m_rootContentLayer->setPosition(FloatPoint()); |
1029 m_rootContentLayer->setOwnerNodeId(DOMNodeIds::idForNode(m_layoutView.no
de())); | 1026 m_rootContentLayer->setOwnerNodeId(DOMNodeIds::idForNode(m_layoutView.no
de())); |
1030 | 1027 |
1031 // FIXME: with rootLayerScrolls, we probably don't even need m_rootConte
ntLayer? | 1028 // FIXME: with rootLayerScrolls, we probably don't even need m_rootConte
ntLayer? |
1032 if (!(settings && settings->rootLayerScrolls())) { | 1029 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
1033 // Need to clip to prevent transformed content showing outside this
frame | 1030 // Need to clip to prevent transformed content showing outside this
frame |
1034 m_rootContentLayer->setMasksToBounds(true); | 1031 m_rootContentLayer->setMasksToBounds(true); |
1035 } | 1032 } |
1036 } | 1033 } |
1037 | 1034 |
1038 if (!m_overflowControlsHostLayer) { | 1035 if (!m_overflowControlsHostLayer) { |
1039 ASSERT(!m_scrollLayer); | 1036 ASSERT(!m_scrollLayer); |
1040 ASSERT(!m_containerLayer); | 1037 ASSERT(!m_containerLayer); |
1041 | 1038 |
1042 // Create a layer to host the clipping layer and the overflow controls l
ayers. | 1039 // Create a layer to host the clipping layer and the overflow controls l
ayers. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 } else if (graphicsLayer == m_scrollLayer.get()) { | 1241 } else if (graphicsLayer == m_scrollLayer.get()) { |
1245 name = "Frame Scrolling Layer"; | 1242 name = "Frame Scrolling Layer"; |
1246 } else { | 1243 } else { |
1247 ASSERT_NOT_REACHED(); | 1244 ASSERT_NOT_REACHED(); |
1248 } | 1245 } |
1249 | 1246 |
1250 return name; | 1247 return name; |
1251 } | 1248 } |
1252 | 1249 |
1253 } // namespace blink | 1250 } // namespace blink |
OLD | NEW |