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

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: Address Vollick comments 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..282b18ade30c66c12fe218fa3f21b28fef674f09 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"
jbroman 2016/01/23 23:55:09 This include doesn't seem to be used; am I missing
majidvp 2016/01/25 20:40:10 removed.
#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)
jbroman 2016/01/23 23:55:09 Has a core/css/ expert looked at this logic before
majidvp 2016/01/25 20:40:10 Not yet, +esprehn@ to check. Basically I see two o
+{
+ ASSERT(isStyledElement());
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("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