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