Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| index b8440dc009530511a66b0bc3962c79e57523656f..05be3ec30996d6f9aadf78b2db08b70c8eb12529 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -65,6 +65,7 @@ |
| #include "platform/graphics/paint/CullRect.h" |
| #include "platform/graphics/paint/PaintController.h" |
| #include "platform/graphics/paint/TransformDisplayItem.h" |
| +#include "public/platform/WebCompositorMutableProperties.h" |
| #include "wtf/CurrentTime.h" |
| #include "wtf/text/StringBuilder.h" |
| @@ -557,6 +558,8 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration() |
| if (layerConfigChanged || maskLayerChanged) |
| updatePaintingPhases(); |
| + updateElementIdAndMutableProperties(); |
| + |
| return layerConfigChanged; |
| } |
| @@ -744,6 +747,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry(const PaintLayer* compo |
| updateContentsRect(); |
| updateBackgroundColor(); |
| updateDrawsContent(); |
| + updateElementIdAndMutableProperties(); |
| updateContentsOpaque(); |
| updateAfterPartResize(); |
| updateRenderingContext(); |
| @@ -1506,6 +1510,34 @@ void CompositedLayerMapping::updateShouldFlattenTransform() |
| } |
| } |
| +void CompositedLayerMapping::updateElementIdAndMutableProperties() |
| +{ |
| + if (!RuntimeEnabledFeatures::compositorWorkerEnabled()) |
| + return; |
| + |
| + TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositedLayerMapping::updateElementId()"); |
| + |
| + uint64_t elementId = 0; |
| + uint32_t mainMutableProperties = WebCompositorMutablePropertyNone; |
| + uint32_t scrollMutableProperties = WebCompositorMutablePropertyNone; |
| + |
| + if (m_owningLayer.layoutObject()->style()->hasCompositorProxy()) { |
| + if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode()) { |
| + elementId = DOMNodeIds::idForNode(owningNode); |
| + mainMutableProperties = WebCompositorMutablePropertyOpacity | WebCompositorMutablePropertyTransform; |
| + scrollMutableProperties = WebCompositorMutablePropertyScrollLeft | WebCompositorMutablePropertyScrollTop; |
| + } |
| + } |
| + |
| + m_graphicsLayer->setElementId(elementId); |
|
chrishtr
2015/11/24 16:22:50
Can an element which is indirectly composited end
Ian Vollick
2015/11/25 18:28:45
Nope, a CompositorProxy is a direct compositing re
|
| + m_graphicsLayer->setMutableProperties(mainMutableProperties); |
| + |
| + if (m_scrollingContentsLayer.get()) { |
| + m_scrollingContentsLayer->setElementId(elementId); |
| + m_scrollingContentsLayer->setMutableProperties(scrollMutableProperties); |
| + } |
| +} |
| + |
| bool CompositedLayerMapping::updateForegroundLayer(bool needsForegroundLayer) |
| { |
| bool layerChanged = false; |