Index: third_party/WebKit/Source/core/dom/Element.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp |
index b13034286d5a965a4bb18eaf55323a18132a2e69..90c312681b90bb774806a9350e906fb4b8edaf0a 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -38,6 +38,7 @@ |
#include "core/XMLNames.h" |
#include "core/animation/AnimationTimeline.h" |
#include "core/animation/css/CSSAnimations.h" |
+#include "core/css/CSSFunctionValue.h" |
#include "core/css/CSSImageValue.h" |
#include "core/css/CSSStyleSheet.h" |
#include "core/css/CSSValuePool.h" |
@@ -124,7 +125,9 @@ |
#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/UserGestureIndicator.h" |
#include "platform/graphics/CompositorMutableProperties.h" |
+#include "platform/graphics/CompositorMutation.h" |
#include "platform/scroll/ScrollableArea.h" |
+#include "platform/transforms/MatrixTransformOperation.h" |
#include "wtf/BitVector.h" |
#include "wtf/HashFunctions.h" |
#include "wtf/text/CString.h" |
@@ -994,6 +997,28 @@ void Element::decrementCompositorProxiedProperties(uint32_t mutableProperties) |
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy)); |
} |
+void Element::updateFromMutation(const CompositorMutation& mutation) |
+{ |
+ ASSERT(isStyledElement()); |
+ TRACE_EVENT0("compositor-worker", "Element::updateFromMutation"); |
+ // Apply opacity and transform by updating inline style. scroll{Top,Left} |
+ // are updated as part of layer tree sync during the commit. |
+ if (mutation.isOpacityMutated()) |
+ setInlineStyleProperty(CSSPropertyOpacity, mutation.opacity(), CSSPrimitiveValue::UnitType::Number); |
+ if (mutation.isTransformMutated()) { |
+ RefPtrWillBeRawPtr<CSSValueList> valueList(CSSValueList::createSpaceSeparated()); |
+ RefPtrWillBeRawPtr<CSSFunctionValue> matrixValue(CSSFunctionValue::create(CSSValueMatrix3d)); |
+ for (int col = 0; col < 4; col++) { |
+ for (int row = 0; row < 4; row++) { |
+ matrixValue->append(cssValuePool().createValue(mutation.transform().get(row, col), CSSPrimitiveValue::UnitType::Pixels)); |
+ } |
+ } |
+ valueList->append(matrixValue.release()); |
+ ensureMutableInlineStyle().setProperty(CSSPropertyTransform, valueList.release()); |
+ inlineStyleChanged(); |
+ } |
+} |
+ |
uint32_t Element::compositorMutableProperties() const |
{ |
if (!hasRareData()) |