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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "core/rendering/RenderFlowThread.h" | 58 #include "core/rendering/RenderFlowThread.h" |
59 #include "core/rendering/RenderGeometryMap.h" | 59 #include "core/rendering/RenderGeometryMap.h" |
60 #include "core/rendering/RenderGrid.h" | 60 #include "core/rendering/RenderGrid.h" |
61 #include "core/rendering/RenderImage.h" | 61 #include "core/rendering/RenderImage.h" |
62 #include "core/rendering/RenderImageResourceStyleImage.h" | 62 #include "core/rendering/RenderImageResourceStyleImage.h" |
63 #include "core/rendering/RenderInline.h" | 63 #include "core/rendering/RenderInline.h" |
64 #include "core/rendering/RenderLayer.h" | 64 #include "core/rendering/RenderLayer.h" |
65 #include "core/rendering/RenderListItem.h" | 65 #include "core/rendering/RenderListItem.h" |
66 #include "core/rendering/RenderMarquee.h" | 66 #include "core/rendering/RenderMarquee.h" |
67 #include "core/rendering/RenderObjectInlines.h" | 67 #include "core/rendering/RenderObjectInlines.h" |
68 #include "core/rendering/RenderPart.h" | |
69 #include "core/rendering/RenderScrollbarPart.h" | 68 #include "core/rendering/RenderScrollbarPart.h" |
70 #include "core/rendering/RenderTableCaption.h" | 69 #include "core/rendering/RenderTableCaption.h" |
71 #include "core/rendering/RenderTableCell.h" | 70 #include "core/rendering/RenderTableCell.h" |
72 #include "core/rendering/RenderTableCol.h" | 71 #include "core/rendering/RenderTableCol.h" |
73 #include "core/rendering/RenderTableRow.h" | 72 #include "core/rendering/RenderTableRow.h" |
74 #include "core/rendering/RenderTheme.h" | 73 #include "core/rendering/RenderTheme.h" |
75 #include "core/rendering/RenderView.h" | 74 #include "core/rendering/RenderView.h" |
76 #include "core/rendering/compositing/CompositedLayerMapping.h" | 75 #include "core/rendering/compositing/CompositedLayerMapping.h" |
77 #include "core/rendering/compositing/RenderLayerCompositor.h" | 76 #include "core/rendering/compositing/RenderLayerCompositor.h" |
78 #include "core/rendering/style/ContentData.h" | 77 #include "core/rendering/style/ContentData.h" |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 { | 1415 { |
1417 if (!isRooted()) | 1416 if (!isRooted()) |
1418 return 0; | 1417 return 0; |
1419 | 1418 |
1420 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta
iner()); | 1419 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta
iner()); |
1421 } | 1420 } |
1422 | 1421 |
1423 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const | 1422 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const |
1424 { | 1423 { |
1425 RenderLayerModelObject* container = 0; | 1424 RenderLayerModelObject* container = 0; |
1426 // FIXME: CompositingState is not necessarily up to date for many callers of
this function. | 1425 if (view()->usesCompositing()) { |
1427 DisableCompositingQueryAsserts disabler; | 1426 // FIXME: CompositingState is not necessarily up to date for many caller
s of this function. |
| 1427 DisableCompositingQueryAsserts disabler; |
1428 | 1428 |
1429 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint
InvalidationCrossingFrameBoundaries()) | 1429 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForP
aintInvalidation()) |
1430 container = compositingLayer->renderer(); | 1430 container = compositingLayer->renderer(); |
| 1431 } |
1431 return container; | 1432 return container; |
1432 } | 1433 } |
1433 | 1434 |
1434 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA
ncestors(const RenderLayerModelObject* paintInvalidationContainer) const | 1435 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA
ncestors(const RenderLayerModelObject* paintInvalidationContainer) const |
1435 { | 1436 { |
1436 | 1437 |
1437 if (document().view()->hasSoftwareFilters()) { | 1438 if (document().view()->hasSoftwareFilters()) { |
1438 if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilte
rLayer()) | 1439 if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilte
rLayer()) |
1439 return enclosingFilterLayer->renderer(); | 1440 return enclosingFilterLayer->renderer(); |
1440 } | 1441 } |
1441 | 1442 |
1442 // If we have a flow thread, then we need to do individual paint invalidatio
ns within the RenderRegions instead. | 1443 // If we have a flow thread, then we need to do individual paint invalidatio
ns within the RenderRegions instead. |
1443 // Return the flow thread as a paint invalidation container in order to crea
te a chokepoint that allows us to change | 1444 // Return the flow thread as a paint invalidation container in order to crea
te a chokepoint that allows us to change |
1444 // paint invalidation to do individual region paint invalidations. | 1445 // paint invalidation to do individual region paint invalidations. |
1445 if (RenderFlowThread* parentRenderFlowThread = flowThreadContainingBlock())
{ | 1446 if (RenderFlowThread* parentRenderFlowThread = flowThreadContainingBlock())
{ |
1446 // If we have already found a paint invalidation container then we will
invalidate paints in that container only if it is part of the same | 1447 // If we have already found a paint invalidation container then we will
invalidate paints in that container only if it is part of the same |
1447 // flow thread. Otherwise we will need to catch the paint invalidation c
all and send it to the flow thread. | 1448 // flow thread. Otherwise we will need to catch the paint invalidation c
all and send it to the flow thread. |
1448 if (!paintInvalidationContainer || paintInvalidationContainer->flowThrea
dContainingBlock() != parentRenderFlowThread) | 1449 if (!paintInvalidationContainer || paintInvalidationContainer->flowThrea
dContainingBlock() != parentRenderFlowThread) |
1449 paintInvalidationContainer = parentRenderFlowThread; | 1450 paintInvalidationContainer = parentRenderFlowThread; |
1450 } | 1451 } |
1451 | 1452 return paintInvalidationContainer ? paintInvalidationContainer : view(); |
1452 if (paintInvalidationContainer) | |
1453 return paintInvalidationContainer; | |
1454 | |
1455 RenderView* renderView = view(); | |
1456 while (renderView->frame()->ownerRenderer()) | |
1457 renderView = renderView->frame()->ownerRenderer()->view(); | |
1458 return renderView; | |
1459 } | 1453 } |
1460 | 1454 |
1461 bool RenderObject::isPaintInvalidationContainer() const | 1455 bool RenderObject::isPaintInvalidationContainer() const |
1462 { | 1456 { |
1463 return hasLayer() && toRenderLayerModelObject(this)->layer()->isPaintInvalid
ationContainer(); | 1457 return hasLayer() && toRenderLayerModelObject(this)->layer()->isPaintInvalid
ationContainer(); |
1464 } | 1458 } |
1465 | 1459 |
1466 template <typename T> | 1460 template <typename T> |
1467 void addJsonObjectForRect(TracedValue* value, const char* name, const T& rect) | 1461 void addJsonObjectForRect(TracedValue* value, const char* name, const T& rect) |
1468 { | 1462 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 if (paintInvalidationContainer->isRenderFlowThread()) { | 1501 if (paintInvalidationContainer->isRenderFlowThread()) { |
1508 toRenderFlowThread(paintInvalidationContainer)->repaintRectangleInRegion
s(r); | 1502 toRenderFlowThread(paintInvalidationContainer)->repaintRectangleInRegion
s(r); |
1509 return; | 1503 return; |
1510 } | 1504 } |
1511 | 1505 |
1512 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l
ayer()->requiresFullLayerImageForFilters()) { | 1506 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l
ayer()->requiresFullLayerImageForFilters()) { |
1513 paintInvalidationContainer->layer()->repainter().setFilterBackendNeedsRe
paintingInRect(r); | 1507 paintInvalidationContainer->layer()->repainter().setFilterBackendNeedsRe
paintingInRect(r); |
1514 return; | 1508 return; |
1515 } | 1509 } |
1516 | 1510 |
| 1511 RenderView* v = view(); |
1517 if (paintInvalidationContainer->isRenderView()) { | 1512 if (paintInvalidationContainer->isRenderView()) { |
1518 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r)
; | 1513 ASSERT(paintInvalidationContainer == v); |
| 1514 v->invalidatePaintForRectangle(r); |
1519 return; | 1515 return; |
1520 } | 1516 } |
1521 | 1517 |
1522 if (view()->usesCompositing()) { | 1518 if (v->usesCompositing()) { |
1523 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta
iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo
ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); | 1519 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta
iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo
ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); |
1524 paintInvalidationContainer->layer()->repainter().setBackingNeedsRepaintI
nRect(r); | 1520 paintInvalidationContainer->layer()->repainter().setBackingNeedsRepaintI
nRect(r); |
1525 } | 1521 } |
1526 } | 1522 } |
1527 | 1523 |
1528 void RenderObject::paintInvalidationForWholeRenderer() const | 1524 void RenderObject::paintInvalidationForWholeRenderer() const |
1529 { | 1525 { |
1530 if (!isRooted()) | 1526 if (!isRooted()) |
1531 return; | 1527 return; |
1532 | 1528 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); | 1739 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); |
1744 } | 1740 } |
1745 | 1741 |
1746 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval
idationState* paintInvalidationState) const | 1742 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval
idationState* paintInvalidationState) const |
1747 { | 1743 { |
1748 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai
ner, paintInvalidationState)); | 1744 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai
ner, paintInvalidationState)); |
1749 r.inflate(outlineWidth); | 1745 r.inflate(outlineWidth); |
1750 return r; | 1746 return r; |
1751 } | 1747 } |
1752 | 1748 |
1753 LayoutRect RenderObject::absoluteClippedOverflowRect() const | |
1754 { | |
1755 return clippedOverflowRectForPaintInvalidation(view()); | |
1756 } | |
1757 | |
1758 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject*, const PaintInvalidationState*) const | 1749 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject*, const PaintInvalidationState*) const |
1759 { | 1750 { |
1760 ASSERT_NOT_REACHED(); | 1751 ASSERT_NOT_REACHED(); |
1761 return LayoutRect(); | 1752 return LayoutRect(); |
1762 } | 1753 } |
1763 | 1754 |
1764 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalida
tionState* paintInvalidationState) const | 1755 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalida
tionState* paintInvalidationState) const |
1765 { | 1756 { |
1766 if (paintInvalidationContainer == this) | 1757 if (paintInvalidationContainer == this) |
1767 return; | 1758 return; |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3468 { | 3459 { |
3469 if (object1) { | 3460 if (object1) { |
3470 const blink::RenderObject* root = object1; | 3461 const blink::RenderObject* root = object1; |
3471 while (root->parent()) | 3462 while (root->parent()) |
3472 root = root->parent(); | 3463 root = root->parent(); |
3473 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3464 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3474 } | 3465 } |
3475 } | 3466 } |
3476 | 3467 |
3477 #endif | 3468 #endif |
OLD | NEW |