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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1602343002: compositor-worker: cc->blink mutation plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-ian-patch
Patch Set: Fix blimp issue Created 4 years, 11 months 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/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())

Powered by Google App Engine
This is Rietveld 408576698