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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2556803004: [SPInvalidation] Invalidate paint property when transform etc. change (Closed)
Patch Set: Rebase on origin 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 1456
1457 StyleDifference LayoutObject::adjustStyleDifference( 1457 StyleDifference LayoutObject::adjustStyleDifference(
1458 StyleDifference diff) const { 1458 StyleDifference diff) const {
1459 if (diff.transformChanged() && isSVG()) { 1459 if (diff.transformChanged() && isSVG()) {
1460 // Skip a full layout for transforms at the html/svg boundary which do not 1460 // Skip a full layout for transforms at the html/svg boundary which do not
1461 // affect sizes inside SVG. 1461 // affect sizes inside SVG.
1462 if (!isSVGRoot()) 1462 if (!isSVGRoot())
1463 diff.setNeedsFullLayout(); 1463 diff.setNeedsFullLayout();
1464 } 1464 }
1465 1465
1466 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 1466 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
1467 // Text nodes share style with their parents but the checked styles don't 1467 // Text nodes share style with their parents but the checked styles don't
1468 // apply to them, hence the !isText() check. 1468 // apply to them, hence the !isText() check.
1469 if (!isText() && (diff.transformChanged() || diff.opacityChanged() || 1469 if (!isText() && (diff.transformChanged() || diff.opacityChanged() ||
1470 diff.zIndexChanged() || diff.filterChanged() || 1470 diff.zIndexChanged() || diff.filterChanged() ||
1471 diff.backdropFilterChanged())) { 1471 diff.backdropFilterChanged())) {
1472 // We don't need to invalidate paint of objects on SPv2 when only paint 1472 // We don't need to invalidate paint of objects on SPv2 when only paint
1473 // property or paint order change. Mark the painting layer needing repaint 1473 // property or paint order change. Mark the painting layer needing repaint
1474 // for changed paint property or paint order. Raster invalidation will be 1474 // for changed paint property or paint order. Raster invalidation will be
1475 // issued if needed during paint. 1475 // issued if needed during paint.
1476 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); 1476 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
1477 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint();
1477 1478
1478 // When transform, opacity, etc. change, paint properties will also change 1479 // When transform, opacity, etc. change, paint properties will also change
1479 // so we need to mark this object as needing an update. 1480 // so we need to mark this object as needing an update.
1480 getMutableForPainting().setNeedsPaintPropertyUpdate(); 1481 getMutableForPainting().setNeedsPaintPropertyUpdate();
1481 } 1482 }
1482 } else { 1483 }
1484
1485 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
1483 // If transform changed, and the layer does not paint into its own separate 1486 // If transform changed, and the layer does not paint into its own separate
1484 // backing, then we need to invalidate paints. 1487 // backing, then we need to invalidate paints.
1485 if (diff.transformChanged()) { 1488 if (diff.transformChanged()) {
1486 // Text nodes share style with their parents but transforms don't apply to 1489 // Text nodes share style with their parents but transforms don't apply to
1487 // them, hence the !isText() check. 1490 // them, hence the !isText() check.
1488 if (!isText() && (!hasLayer() || 1491 if (!isText() && (!hasLayer() ||
1489 !toLayoutBoxModelObject(this) 1492 !toLayoutBoxModelObject(this)
1490 ->layer() 1493 ->layer()
1491 ->hasStyleDeterminedDirectCompositingReasons())) 1494 ->hasStyleDeterminedDirectCompositingReasons()))
1492 diff.setNeedsPaintInvalidationSubtree(); 1495 diff.setNeedsPaintInvalidationSubtree();
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3501 const blink::LayoutObject* root = object1; 3504 const blink::LayoutObject* root = object1;
3502 while (root->parent()) 3505 while (root->parent())
3503 root = root->parent(); 3506 root = root->parent();
3504 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3507 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3505 } else { 3508 } else {
3506 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3509 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3507 } 3510 }
3508 } 3511 }
3509 3512
3510 #endif 3513 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698