| OLD | NEW |
| 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. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 StyleDifference LayoutObject::adjustStyleDifference(StyleDifference diff) const | 1417 StyleDifference LayoutObject::adjustStyleDifference(StyleDifference diff) const |
| 1418 { | 1418 { |
| 1419 if (diff.transformChanged() && isSVG()) { | 1419 if (diff.transformChanged() && isSVG()) { |
| 1420 // Skip a full layout for transforms at the html/svg boundary which do n
ot affect sizes inside SVG. | 1420 // Skip a full layout for transforms at the html/svg boundary which do n
ot affect sizes inside SVG. |
| 1421 if (!isSVGRoot()) | 1421 if (!isSVGRoot()) |
| 1422 diff.setNeedsFullLayout(); | 1422 diff.setNeedsFullLayout(); |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 // If transform changed, and the layer does not paint into its own separate
backing, then we need to invalidate paints. | 1425 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 1426 if (diff.transformChanged()) { | 1426 // Text nodes share style with their parents but the checked styles don'
t apply to them, |
| 1427 // Text nodes share style with their parents but transforms don't apply
to them, | |
| 1428 // hence the !isText() check. | 1427 // hence the !isText() check. |
| 1429 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()-
>hasStyleDeterminedDirectCompositingReasons())) | 1428 if (!isText() |
| 1430 diff.setNeedsPaintInvalidationSubtree(); | 1429 && (diff.transformChanged() || diff.opacityChanged() || diff.zIndexC
hanged() || diff.filterChanged() || diff.backdropFilterChanged())) { |
| 1431 } | 1430 // We don't need to invalidate paint of objects on SPv2 when only pa
int property or |
| 1431 // paint order change. Mark the painting layer needing repaint for c
hanged paint |
| 1432 // property or paint order. Raster invalidation will be issued if ne
eded during paint. |
| 1433 ObjectPaintInvalidator(*this).slowSetPaintingLayerNeedsRepaint(); |
| 1434 } |
| 1435 } else { |
| 1436 // If transform changed, and the layer does not paint into its own separ
ate backing, then we need to invalidate paints. |
| 1437 if (diff.transformChanged()) { |
| 1438 // Text nodes share style with their parents but transforms don't ap
ply to them, |
| 1439 // hence the !isText() check. |
| 1440 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->laye
r()->hasStyleDeterminedDirectCompositingReasons())) |
| 1441 diff.setNeedsPaintInvalidationSubtree(); |
| 1442 } |
| 1432 | 1443 |
| 1433 // If opacity or zIndex changed, and the layer does not paint into its own s
eparate backing, then we need to invalidate paints (also | 1444 // If opacity or zIndex changed, and the layer does not paint into its o
wn separate backing, then we need to invalidate paints (also |
| 1434 // ignoring text nodes) | 1445 // ignoring text nodes) |
| 1435 if (diff.opacityChanged() || diff.zIndexChanged()) { | 1446 if (diff.opacityChanged() || diff.zIndexChanged()) { |
| 1436 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()-
>hasStyleDeterminedDirectCompositingReasons())) | 1447 if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->laye
r()->hasStyleDeterminedDirectCompositingReasons())) |
| 1437 diff.setNeedsPaintInvalidationSubtree(); | 1448 diff.setNeedsPaintInvalidationSubtree(); |
| 1438 } | 1449 } |
| 1439 | 1450 |
| 1440 // If filter changed, and the layer does not paint into its own separate bac
king or it paints with filters, then we need to invalidate paints. | 1451 // If filter changed, and the layer does not paint into its own separate
backing or it paints with filters, then we need to invalidate paints. |
| 1441 if (diff.filterChanged() && hasLayer()) { | 1452 if (diff.filterChanged() && hasLayer()) { |
| 1442 PaintLayer* layer = toLayoutBoxModelObject(this)->layer(); | 1453 PaintLayer* layer = toLayoutBoxModelObject(this)->layer(); |
| 1443 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint
sWithFilters()) | 1454 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->p
aintsWithFilters()) |
| 1444 diff.setNeedsPaintInvalidationSubtree(); | 1455 diff.setNeedsPaintInvalidationSubtree(); |
| 1445 } | 1456 } |
| 1446 | 1457 |
| 1447 // If backdrop filter changed, and the layer does not paint into its own sep
arate backing or it paints with filters, then we need to invalidate paints. | 1458 // If backdrop filter changed, and the layer does not paint into its own
separate backing or it paints with filters, then we need to invalidate paints. |
| 1448 if (diff.backdropFilterChanged() && hasLayer()) { | 1459 if (diff.backdropFilterChanged() && hasLayer()) { |
| 1449 PaintLayer* layer = toLayoutBoxModelObject(this)->layer(); | 1460 PaintLayer* layer = toLayoutBoxModelObject(this)->layer(); |
| 1450 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->paint
sWithBackdropFilters()) | 1461 if (!layer->hasStyleDeterminedDirectCompositingReasons() || layer->p
aintsWithBackdropFilters()) |
| 1451 diff.setNeedsPaintInvalidationSubtree(); | 1462 diff.setNeedsPaintInvalidationSubtree(); |
| 1463 } |
| 1452 } | 1464 } |
| 1453 | 1465 |
| 1454 // Optimization: for decoration/color property changes, invalidation is only
needed if we have style or text affected by these properties. | 1466 // Optimization: for decoration/color property changes, invalidation is only
needed if we have style or text affected by these properties. |
| 1455 if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) { | 1467 if (diff.textDecorationOrColorChanged() && !diff.needsPaintInvalidation()) { |
| 1456 if (style()->hasBorder() || style()->hasOutline() | 1468 if (style()->hasBorder() || style()->hasOutline() |
| 1457 || style()->hasBackgroundRelatedColorReferencingCurrentColor() | 1469 || style()->hasBackgroundRelatedColorReferencingCurrentColor() |
| 1458 // Skip any text nodes that do not contain text boxes. Whitespace ca
nnot be | 1470 // Skip any text nodes that do not contain text boxes. Whitespace ca
nnot be |
| 1459 // skipped or we will miss invalidating decorations (e.g., underline
s). | 1471 // skipped or we will miss invalidating decorations (e.g., underline
s). |
| 1460 || (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()) | 1472 || (isText() && !isBR() && toLayoutText(this)->hasTextBoxes()) |
| 1461 // Caret is painted in text color. | 1473 // Caret is painted in text color. |
| (...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3257 const blink::LayoutObject* root = object1; | 3269 const blink::LayoutObject* root = object1; |
| 3258 while (root->parent()) | 3270 while (root->parent()) |
| 3259 root = root->parent(); | 3271 root = root->parent(); |
| 3260 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3272 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3261 } else { | 3273 } else { |
| 3262 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3274 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3263 } | 3275 } |
| 3264 } | 3276 } |
| 3265 | 3277 |
| 3266 #endif | 3278 #endif |
| OLD | NEW |