Chromium Code Reviews| 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 1ef94b7943723c3618177835e2024538c1dc1e0a..fa13ad4a2368160dbd85569e4e069787b35db668 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" |
| @@ -123,7 +124,9 @@ |
| #include "platform/EventDispatchForbiddenScope.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| #include "platform/UserGestureIndicator.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" |
| @@ -993,6 +996,26 @@ 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"); |
|
flackr
2016/01/22 14:34:41
We should have a comment that the scroll offset is
|
| + 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()) |