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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2600333002: Disable some PaintPropertyTreeBuilder features for SPv1 SlimmingPaintInvalidation (Closed)
Patch Set: - Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index 6baebf02bfb5a7794626ffa4a5af5af5d5137593..0f2a240523c2117b69d7d210c97bbad3833907ec 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -357,15 +357,22 @@ void PaintPropertyTreeBuilder::updateTransform(
if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) {
const ComputedStyle& style = object.styleRef();
- CompositingReasons compositingReasons =
- compositingReasonsForTransform(object);
-
- // A transform node is allocated for transforms, preserves-3d and any
- // direct compositing reason. The latter is required because this is the
- // only way to represent compositing both an element and its stacking
- // descendants.
- if (object.isBox() && (style.hasTransform() || style.preserves3D() ||
- compositingReasons != CompositingReasonNone)) {
+ bool needsTransformNode = false;
+ CompositingReasons compositingReasons = CompositingReasonNone;
+ if (object.isBox()) {
+ // A transform node is allocated for transforms, preserves-3d (SPv2) and
+ // any direct compositing reason (SPv2). The latter is required because
+ // this is the only way to represent compositing both an element and its
+ // stacking descendants.
+ needsTransformNode |= style.hasTransform();
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ needsTransformNode |= style.preserves3D();
chrishtr 2016/12/28 18:15:18 Are you sure preserve-3D is not required for Slimm
Xianzhu 2016/12/28 18:25:29 Yes. GeometryMapper doesn't use FlattenInheritedTr
+ compositingReasons = compositingReasonsForTransform(object);
+ needsTransformNode |= (compositingReasons != CompositingReasonNone);
+ }
+ }
+
+ if (needsTransformNode) {
auto& box = toLayoutBox(object);
TransformationMatrix matrix;
style.applyTransform(
@@ -378,7 +385,8 @@ void PaintPropertyTreeBuilder::updateTransform(
// If a node with transform-style: preserve-3d does not exist in an
// existing rendering context, it establishes a new one.
unsigned renderingContextID = context.current.renderingContextID;
- if (style.preserves3D() && !renderingContextID)
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
+ style.preserves3D() && !renderingContextID)
renderingContextID = PtrHash<const LayoutObject>::hash(&object);
auto& properties = object.getMutableForPainting().ensurePaintProperties();
@@ -395,7 +403,8 @@ void PaintPropertyTreeBuilder::updateTransform(
const auto* properties = object.paintProperties();
if (properties && properties->transform()) {
context.current.transform = properties->transform();
- if (object.styleRef().preserves3D()) {
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
+ object.styleRef().preserves3D()) {
context.current.renderingContextID =
properties->transform()->renderingContextID();
context.current.shouldFlattenInheritedTransform = false;
@@ -409,6 +418,9 @@ void PaintPropertyTreeBuilder::updateTransform(
void PaintPropertyTreeBuilder::updateEffect(
const LayoutObject& object,
PaintPropertyTreeBuilderContext& context) {
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+ return;
+
const ComputedStyle& style = object.styleRef();
const bool isCSSIsolatedGroup =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698