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

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 test and rebase 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 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())
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/platform/graphics/CompositorMutation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698