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 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 object.invalidateDisplayItemClients(m_paintInvalidationContainer, Pa
intInvalidationFull, invalidationRect, invalidationRect); | 3384 object.invalidateDisplayItemClients(m_paintInvalidationContainer, Pa
intInvalidationFull, invalidationRect, invalidationRect); |
3385 } | 3385 } |
3386 private: | 3386 private: |
3387 const LayoutBoxModelObject& m_paintInvalidationContainer; | 3387 const LayoutBoxModelObject& m_paintInvalidationContainer; |
3388 }; | 3388 }; |
3389 | 3389 |
3390 const LayoutBoxModelObject& paintInvalidationContainer = *paintInvalidationL
ayer->layoutObject(); | 3390 const LayoutBoxModelObject& paintInvalidationContainer = *paintInvalidationL
ayer->layoutObject(); |
3391 traverseNonCompositingDescendants(const_cast<LayoutObject&>(object), Functor
(paintInvalidationContainer)); | 3391 traverseNonCompositingDescendants(const_cast<LayoutObject&>(object), Functor
(paintInvalidationContainer)); |
3392 } | 3392 } |
3393 | 3393 |
| 3394 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo
xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) const |
| 3395 { |
| 3396 // These disablers are valid because we want to use the current compositing/
invalidation status. |
| 3397 DisablePaintInvalidationStateAsserts invalidationDisabler; |
| 3398 DisableCompositingQueryAsserts compositingDisabler; |
| 3399 |
| 3400 LayoutRect invalidationRect = previousPaintInvalidationRect(); |
| 3401 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida
tionContainer); |
| 3402 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
PaintInvalidationLayer); |
| 3403 invalidateDisplayItemClients(paintInvalidationContainer, PaintInvalidationLa
yer, invalidationRect, invalidationRect); |
| 3404 } |
| 3405 |
3394 void LayoutObject::invalidatePaintIncludingNonCompositingDescendants() | 3406 void LayoutObject::invalidatePaintIncludingNonCompositingDescendants() |
3395 { | 3407 { |
3396 class Functor : public LayoutObjectTraversalFunctor { | 3408 class Functor : public LayoutObjectTraversalFunctor { |
3397 public: | 3409 public: |
3398 explicit Functor(const LayoutBoxModelObject& paintInvalidationContainer)
: m_paintInvalidationContainer(paintInvalidationContainer) { } | 3410 explicit Functor(const LayoutBoxModelObject& paintInvalidationContainer)
: m_paintInvalidationContainer(paintInvalidationContainer) { } |
3399 void operator()(LayoutObject& object) const override | 3411 void operator()(LayoutObject& object) const override |
3400 { | 3412 { |
3401 LayoutRect invalidationRect = object.previousPaintInvalidationRect()
; | 3413 object.invalidatePaintOfPreviousPaintInvalidationRect(m_paintInvalid
ationContainer, PaintInvalidationLayer); |
3402 object.adjustInvalidationRectForCompositedScrolling(invalidationRect
, m_paintInvalidationContainer); | 3414 object.setPreviousPaintInvalidationRect(LayoutRect()); |
3403 object.invalidatePaintUsingContainer(m_paintInvalidationContainer, i
nvalidationRect, PaintInvalidationLayer); | |
3404 object.invalidateDisplayItemClients(m_paintInvalidationContainer, Pa
intInvalidationLayer, invalidationRect, invalidationRect); | |
3405 } | 3415 } |
3406 private: | 3416 private: |
3407 const LayoutBoxModelObject& m_paintInvalidationContainer; | 3417 const LayoutBoxModelObject& m_paintInvalidationContainer; |
3408 }; | 3418 }; |
3409 | 3419 |
3410 // Since we're only painting non-composited layers, we know that they all sh
are the same paintInvalidationContainer. | 3420 // Since we're only painting non-composited layers, we know that they all sh
are the same paintInvalidationContainer. |
3411 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validationOnRootedTree(); | 3421 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validationOnRootedTree(); |
3412 traverseNonCompositingDescendants(*this, Functor(paintInvalidationContainer)
); | 3422 traverseNonCompositingDescendants(*this, Functor(paintInvalidationContainer)
); |
3413 } | 3423 } |
3414 | 3424 |
3415 // FIXME: If we had a flag to force invalidations in a whole subtree, we could g
et rid of this function (crbug.com/410097). | 3425 // FIXME: If we had a flag to force invalidations in a whole subtree, we could g
et rid of this function (crbug.com/410097). |
3416 void LayoutObject::setShouldDoFullPaintInvalidationIncludingNonCompositingDescen
dants() | 3426 void LayoutObject::setShouldDoFullPaintInvalidationIncludingNonCompositingDescen
dants() |
3417 { | 3427 { |
3418 class Functor : public LayoutObjectTraversalFunctor { | 3428 class Functor : public LayoutObjectTraversalFunctor { |
3419 public: | 3429 public: |
3420 void operator()(LayoutObject& object) const override | 3430 void operator()(LayoutObject& object) const override |
3421 { | 3431 { |
3422 object.setShouldDoFullPaintInvalidation(); | 3432 object.setShouldDoFullPaintInvalidation(); |
3423 } | 3433 } |
3424 }; | 3434 }; |
3425 | 3435 |
3426 // Need to access the current compositing status. | 3436 // Need to access the current compositing status. |
3427 DisableCompositingQueryAsserts disabler; | 3437 DisableCompositingQueryAsserts disabler; |
3428 traverseNonCompositingDescendants(*this, Functor()); | 3438 traverseNonCompositingDescendants(*this, Functor()); |
3429 } | 3439 } |
3430 | 3440 |
| 3441 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const
LayoutBoxModelObject& paintInvalidationContainer) |
| 3442 { |
| 3443 invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationContainer, P
aintInvalidationLayer); |
| 3444 setPreviousPaintInvalidationRect(LayoutRect()); |
| 3445 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| 3446 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel
fPaintingLayer()) |
| 3447 child->invalidatePaintIncludingNonSelfPaintingLayerDescendants(paint
InvalidationContainer); |
| 3448 } |
| 3449 } |
| 3450 |
3431 void LayoutObject::setIsSlowRepaintObject(bool isSlowRepaintObject) | 3451 void LayoutObject::setIsSlowRepaintObject(bool isSlowRepaintObject) |
3432 { | 3452 { |
3433 ASSERT(frameView()); | 3453 ASSERT(frameView()); |
3434 if (m_bitfields.isSlowRepaintObject() == isSlowRepaintObject) | 3454 if (m_bitfields.isSlowRepaintObject() == isSlowRepaintObject) |
3435 return; | 3455 return; |
3436 m_bitfields.setIsSlowRepaintObject(isSlowRepaintObject); | 3456 m_bitfields.setIsSlowRepaintObject(isSlowRepaintObject); |
3437 if (isSlowRepaintObject) | 3457 if (isSlowRepaintObject) |
3438 frameView()->addSlowRepaintObject(); | 3458 frameView()->addSlowRepaintObject(); |
3439 else | 3459 else |
3440 frameView()->removeSlowRepaintObject(); | 3460 frameView()->removeSlowRepaintObject(); |
(...skipping 30 matching lines...) Expand all Loading... |
3471 const blink::LayoutObject* root = object1; | 3491 const blink::LayoutObject* root = object1; |
3472 while (root->parent()) | 3492 while (root->parent()) |
3473 root = root->parent(); | 3493 root = root->parent(); |
3474 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3494 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3475 } else { | 3495 } else { |
3476 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3496 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3477 } | 3497 } |
3478 } | 3498 } |
3479 | 3499 |
3480 #endif | 3500 #endif |
OLD | NEW |