| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() | 405 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
| 406 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) | 406 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) |
| 407 && !usesCompositedScrolling() | 407 && !usesCompositedScrolling() |
| 408 && hasOverflowClip()) | 408 && hasOverflowClip()) |
| 409 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); | 409 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); |
| 410 | 410 |
| 411 newPaintInvalidationState.updateForChildren(reason); | 411 newPaintInvalidationState.updateForChildren(reason); |
| 412 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 412 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 413 } | 413 } |
| 414 | 414 |
| 415 static bool compositedScrollsWithRespectTo(const LayoutObject* layoutObject, con
st LayoutBoxModelObject& paintInvalidationContainer) | |
| 416 { | |
| 417 return paintInvalidationContainer.usesCompositedScrolling() && layoutObject
!= &paintInvalidationContainer; | |
| 418 } | |
| 419 | |
| 420 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c
onst | 415 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c
onst |
| 421 { | 416 { |
| 422 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. | 417 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. |
| 423 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 418 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 424 | 419 |
| 425 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 420 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
| 426 // so assert but check that the layer is composited. | 421 // so assert but check that the layer is composited. |
| 427 ASSERT(compositingState() != NotComposited); | 422 ASSERT(compositingState() != NotComposited); |
| 428 | 423 |
| 429 // FIXME: generalize accessors to backing GraphicsLayers so that this code i
s squashing-agnostic. | 424 // FIXME: generalize accessors to backing GraphicsLayers so that this code i
s squashing-agnostic. |
| 430 if (layer()->groupedMapping()) { | 425 if (layer()->groupedMapping()) { |
| 431 LayoutRect paintInvalidationRect = r; | 426 LayoutRect paintInvalidationRect = r; |
| 432 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing
Layer()) { | 427 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing
Layer()) { |
| 433 // Note: the subpixel accumulation of layer() does not need to be ad
ded here. It is already taken into account. | 428 // Note: the subpixel accumulation of layer() does not need to be ad
ded here. It is already taken into account. |
| 434 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida
tionRect), invalidationReason, object); | 429 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida
tionRect), invalidationReason, object); |
| 435 } | 430 } |
| 436 } else if (compositedScrollsWithRespectTo(&object, *this)) { | |
| 437 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect
(r, invalidationReason, object); | |
| 438 } else { | 431 } else { |
| 439 // TODO(chrishtr): we should be able to skip scrolling content layers in
this case. | |
| 440 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval
idationReason, object); | 432 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval
idationReason, object); |
| 441 } | 433 } |
| 442 } | 434 } |
| 443 | 435 |
| 444 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte
mClient& displayItemClient, PaintInvalidationReason invalidationReason, const La
youtObject* layoutObject) const | 436 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte
mClient& displayItemClient, PaintInvalidationReason invalidationReason) const |
| 445 { | 437 { |
| 446 displayItemClient.setDisplayItemsUncached(); | 438 displayItemClient.setDisplayItemsUncached(); |
| 447 | 439 |
| 448 // We need to inform the GraphicsLayer about this paint invalidation only wh
en we are tracking | 440 // We need to inform the GraphicsLayer about this paint invalidation only wh
en we are tracking |
| 449 // paint invalidation or ENABLE(ASSERT). | 441 // paint invalidation or ENABLE(ASSERT). |
| 450 #if !ENABLE(ASSERT) | 442 #if !ENABLE(ASSERT) |
| 451 if (!frameView()->isTrackingPaintInvalidations()) | 443 if (!frameView()->isTrackingPaintInvalidations()) |
| 452 return; | 444 return; |
| 453 #endif | 445 #endif |
| 454 | 446 |
| 455 if (layer()->groupedMapping()) { | 447 if (layer()->groupedMapping()) { |
| 456 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing
Layer()) | 448 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing
Layer()) |
| 457 squashingLayer->displayItemClientWasInvalidated(displayItemClient, i
nvalidationReason); | 449 squashingLayer->displayItemClientWasInvalidated(displayItemClient, i
nvalidationReason); |
| 458 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi
tedLayerMapping()) { | 450 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi
tedLayerMapping()) { |
| 459 if (compositedScrollsWithRespectTo(layoutObject, *this)) | 451 compositedLayerMapping->displayItemClientWasInvalidated(displayItemClien
t, invalidationReason); |
| 460 compositedLayerMapping->scrollingDisplayItemClientWasInvalidated(dis
playItemClient, invalidationReason); | |
| 461 else | |
| 462 compositedLayerMapping->displayItemClientWasInvalidated(displayItemC
lient, invalidationReason); | |
| 463 } | 452 } |
| 464 } | 453 } |
| 465 | 454 |
| 466 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>&
rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl
udeBlockOverflows) const | 455 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>&
rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl
udeBlockOverflows) const |
| 467 { | 456 { |
| 468 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 457 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| 469 // Outlines of out-of-flow positioned descendants are handled in LayoutB
lock::addOutlineRects(). | 458 // Outlines of out-of-flow positioned descendants are handled in LayoutB
lock::addOutlineRects(). |
| 470 if (child->isOutOfFlowPositioned()) | 459 if (child->isOutOfFlowPositioned()) |
| 471 continue; | 460 continue; |
| 472 | 461 |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 if (rootElementStyle->hasBackground()) | 1118 if (rootElementStyle->hasBackground()) |
| 1130 return false; | 1119 return false; |
| 1131 | 1120 |
| 1132 if (node() != document().firstBodyElement()) | 1121 if (node() != document().firstBodyElement()) |
| 1133 return false; | 1122 return false; |
| 1134 | 1123 |
| 1135 return true; | 1124 return true; |
| 1136 } | 1125 } |
| 1137 | 1126 |
| 1138 } // namespace blink | 1127 } // namespace blink |
| OLD | NEW |