Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed layout test (and logged bug) Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9d3e9d969695f6b7824dad2c82eaca3e0626c155..48a3d2811d7e3e89095c231cfff80bce6c403fed 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/WebMutableProperties.h"
#include "wtf/CurrentTime.h"
#include "wtf/text/StringBuilder.h"
@@ -538,6 +539,8 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
if (layerConfigChanged || maskLayerChanged)
updatePaintingPhases();
+ updateElementIdAndMutableProperties();
+
return layerConfigChanged;
}
@@ -725,6 +728,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry(const PaintLayer* compo
updateContentsRect();
updateBackgroundColor();
updateDrawsContent();
+ updateElementIdAndMutableProperties();
updateContentsOpaque();
updateAfterPartResize();
updateRenderingContext();
@@ -1487,6 +1491,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 = WebMutablePropertyNone;
+ uint32_t scrollMutableProperties = WebMutablePropertyNone;
+
+ if (m_owningLayer.layoutObject()->style()->hasCompositorProxy()) {
+ if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode()) {
+ elementId = DOMNodeIds::idForNode(owningNode);
+ mainMutableProperties = WebMutablePropertyOpacity | WebMutablePropertyTransform;
+ scrollMutableProperties = WebMutablePropertyScrollLeft | WebMutablePropertyScrollTop;
+ }
+ }
+
+ m_graphicsLayer->setElementId(elementId);
+ m_graphicsLayer->setMutableProperties(mainMutableProperties);
+
+ if (m_scrollingContentsLayer.get()) {
+ m_scrollingContentsLayer->setElementId(elementId);
+ m_scrollingContentsLayer->setMutableProperties(scrollMutableProperties);
+ }
+}
+
bool CompositedLayerMapping::updateForegroundLayer(bool needsForegroundLayer)
{
bool layerChanged = false;

Powered by Google App Engine
This is Rietveld 408576698