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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "core/rendering/RenderFlowThread.h" | 59 #include "core/rendering/RenderFlowThread.h" |
60 #include "core/rendering/RenderGeometryMap.h" | 60 #include "core/rendering/RenderGeometryMap.h" |
61 #include "core/rendering/RenderGrid.h" | 61 #include "core/rendering/RenderGrid.h" |
62 #include "core/rendering/RenderImage.h" | 62 #include "core/rendering/RenderImage.h" |
63 #include "core/rendering/RenderImageResourceStyleImage.h" | 63 #include "core/rendering/RenderImageResourceStyleImage.h" |
64 #include "core/rendering/RenderInline.h" | 64 #include "core/rendering/RenderInline.h" |
65 #include "core/rendering/RenderLayer.h" | 65 #include "core/rendering/RenderLayer.h" |
66 #include "core/rendering/RenderListItem.h" | 66 #include "core/rendering/RenderListItem.h" |
67 #include "core/rendering/RenderMarquee.h" | 67 #include "core/rendering/RenderMarquee.h" |
68 #include "core/rendering/RenderObjectInlines.h" | 68 #include "core/rendering/RenderObjectInlines.h" |
69 #include "core/rendering/RenderPart.h" | |
70 #include "core/rendering/RenderScrollbarPart.h" | 69 #include "core/rendering/RenderScrollbarPart.h" |
71 #include "core/rendering/RenderTableCaption.h" | 70 #include "core/rendering/RenderTableCaption.h" |
72 #include "core/rendering/RenderTableCell.h" | 71 #include "core/rendering/RenderTableCell.h" |
73 #include "core/rendering/RenderTableCol.h" | 72 #include "core/rendering/RenderTableCol.h" |
74 #include "core/rendering/RenderTableRow.h" | 73 #include "core/rendering/RenderTableRow.h" |
75 #include "core/rendering/RenderTheme.h" | 74 #include "core/rendering/RenderTheme.h" |
76 #include "core/rendering/RenderView.h" | 75 #include "core/rendering/RenderView.h" |
77 #include "core/rendering/compositing/CompositedLayerMapping.h" | 76 #include "core/rendering/compositing/CompositedLayerMapping.h" |
78 #include "core/rendering/compositing/RenderLayerCompositor.h" | 77 #include "core/rendering/compositing/RenderLayerCompositor.h" |
79 #include "core/rendering/style/ContentData.h" | 78 #include "core/rendering/style/ContentData.h" |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 { | 1434 { |
1436 if (!isRooted()) | 1435 if (!isRooted()) |
1437 return 0; | 1436 return 0; |
1438 | 1437 |
1439 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta
iner()); | 1438 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta
iner()); |
1440 } | 1439 } |
1441 | 1440 |
1442 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const | 1441 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const |
1443 { | 1442 { |
1444 RenderLayerModelObject* container = 0; | 1443 RenderLayerModelObject* container = 0; |
1445 // FIXME: CompositingState is not necessarily up to date for many callers of
this function. | 1444 if (view()->usesCompositing()) { |
1446 DisableCompositingQueryAsserts disabler; | 1445 // FIXME: CompositingState is not necessarily up to date for many caller
s of this function. |
| 1446 DisableCompositingQueryAsserts disabler; |
1447 | 1447 |
1448 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint
InvalidationCrossingFrameBoundaries()) | 1448 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForP
aintInvalidation()) |
1449 container = compositingLayer->renderer(); | 1449 container = compositingLayer->renderer(); |
| 1450 } |
1450 return container; | 1451 return container; |
1451 } | 1452 } |
1452 | 1453 |
1453 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA
ncestors(const RenderLayerModelObject* paintInvalidationContainer) const | 1454 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA
ncestors(const RenderLayerModelObject* paintInvalidationContainer) const |
1454 { | 1455 { |
1455 | 1456 |
1456 if (document().view()->hasSoftwareFilters()) { | 1457 if (document().view()->hasSoftwareFilters()) { |
1457 if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilte
rLayer()) | 1458 if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilte
rLayer()) |
1458 return enclosingFilterLayer->renderer(); | 1459 return enclosingFilterLayer->renderer(); |
1459 } | 1460 } |
1460 | 1461 |
1461 // If we have a flow thread, then we need to do individual paint invalidatio
ns within the RenderRegions instead. | 1462 // If we have a flow thread, then we need to do individual paint invalidatio
ns within the RenderRegions instead. |
1462 // Return the flow thread as a paint invalidation container in order to crea
te a chokepoint that allows us to change | 1463 // Return the flow thread as a paint invalidation container in order to crea
te a chokepoint that allows us to change |
1463 // paint invalidation to do individual region paint invalidations. | 1464 // paint invalidation to do individual region paint invalidations. |
1464 if (RenderFlowThread* parentRenderFlowThread = flowThreadContainingBlock())
{ | 1465 if (RenderFlowThread* parentRenderFlowThread = flowThreadContainingBlock())
{ |
1465 // 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 | 1466 // 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 |
1466 // flow thread. Otherwise we will need to catch the paint invalidation c
all and send it to the flow thread. | 1467 // flow thread. Otherwise we will need to catch the paint invalidation c
all and send it to the flow thread. |
1467 if (!paintInvalidationContainer || paintInvalidationContainer->flowThrea
dContainingBlock() != parentRenderFlowThread) | 1468 if (!paintInvalidationContainer || paintInvalidationContainer->flowThrea
dContainingBlock() != parentRenderFlowThread) |
1468 paintInvalidationContainer = parentRenderFlowThread; | 1469 paintInvalidationContainer = parentRenderFlowThread; |
1469 } | 1470 } |
1470 | 1471 return paintInvalidationContainer ? paintInvalidationContainer : view(); |
1471 if (paintInvalidationContainer) | |
1472 return paintInvalidationContainer; | |
1473 | |
1474 RenderView* renderView = view(); | |
1475 while (renderView->frame()->ownerRenderer()) | |
1476 renderView = renderView->frame()->ownerRenderer()->view(); | |
1477 return renderView; | |
1478 } | 1472 } |
1479 | 1473 |
1480 bool RenderObject::isPaintInvalidationContainer() const | 1474 bool RenderObject::isPaintInvalidationContainer() const |
1481 { | 1475 { |
1482 return hasLayer() && toRenderLayerModelObject(this)->layer()->isPaintInvalid
ationContainer(); | 1476 return hasLayer() && toRenderLayerModelObject(this)->layer()->isPaintInvalid
ationContainer(); |
1483 } | 1477 } |
1484 | 1478 |
1485 template <typename T> | 1479 template <typename T> |
1486 void addJsonObjectForRect(TracedValue* value, const char* name, const T& rect) | 1480 void addJsonObjectForRect(TracedValue* value, const char* name, const T& rect) |
1487 { | 1481 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 if (paintInvalidationContainer->isRenderFlowThread()) { | 1520 if (paintInvalidationContainer->isRenderFlowThread()) { |
1527 toRenderFlowThread(paintInvalidationContainer)->repaintRectangleInRegion
s(r); | 1521 toRenderFlowThread(paintInvalidationContainer)->repaintRectangleInRegion
s(r); |
1528 return; | 1522 return; |
1529 } | 1523 } |
1530 | 1524 |
1531 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l
ayer()->requiresFullLayerImageForFilters()) { | 1525 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l
ayer()->requiresFullLayerImageForFilters()) { |
1532 paintInvalidationContainer->layer()->paintInvalidator().setFilterBackend
NeedsRepaintingInRect(r); | 1526 paintInvalidationContainer->layer()->paintInvalidator().setFilterBackend
NeedsRepaintingInRect(r); |
1533 return; | 1527 return; |
1534 } | 1528 } |
1535 | 1529 |
| 1530 RenderView* v = view(); |
1536 if (paintInvalidationContainer->isRenderView()) { | 1531 if (paintInvalidationContainer->isRenderView()) { |
1537 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r)
; | 1532 ASSERT(paintInvalidationContainer == v); |
| 1533 v->invalidatePaintForRectangle(r); |
1538 return; | 1534 return; |
1539 } | 1535 } |
1540 | 1536 |
1541 if (view()->usesCompositing()) { | 1537 if (v->usesCompositing()) { |
1542 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta
iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo
ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); | 1538 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta
iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo
ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); |
1543 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsR
epaintInRect(r); | 1539 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsR
epaintInRect(r); |
1544 } | 1540 } |
1545 } | 1541 } |
1546 | 1542 |
1547 void RenderObject::paintInvalidationForWholeRenderer() const | 1543 void RenderObject::paintInvalidationForWholeRenderer() const |
1548 { | 1544 { |
1549 if (!isRooted()) | 1545 if (!isRooted()) |
1550 return; | 1546 return; |
1551 | 1547 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); | 1758 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); |
1763 } | 1759 } |
1764 | 1760 |
1765 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval
idationState* paintInvalidationState) const | 1761 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval
idationState* paintInvalidationState) const |
1766 { | 1762 { |
1767 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai
ner, paintInvalidationState)); | 1763 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai
ner, paintInvalidationState)); |
1768 r.inflate(outlineWidth); | 1764 r.inflate(outlineWidth); |
1769 return r; | 1765 return r; |
1770 } | 1766 } |
1771 | 1767 |
1772 LayoutRect RenderObject::absoluteClippedOverflowRect() const | |
1773 { | |
1774 return clippedOverflowRectForPaintInvalidation(view()); | |
1775 } | |
1776 | |
1777 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject*, const PaintInvalidationState*) const | 1768 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject*, const PaintInvalidationState*) const |
1778 { | 1769 { |
1779 ASSERT_NOT_REACHED(); | 1770 ASSERT_NOT_REACHED(); |
1780 return LayoutRect(); | 1771 return LayoutRect(); |
1781 } | 1772 } |
1782 | 1773 |
1783 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalida
tionState* paintInvalidationState) const | 1774 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalida
tionState* paintInvalidationState) const |
1784 { | 1775 { |
1785 if (paintInvalidationContainer == this) | 1776 if (paintInvalidationContainer == this) |
1786 return; | 1777 return; |
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3472 { | 3463 { |
3473 if (object1) { | 3464 if (object1) { |
3474 const blink::RenderObject* root = object1; | 3465 const blink::RenderObject* root = object1; |
3475 while (root->parent()) | 3466 while (root->parent()) |
3476 root = root->parent(); | 3467 root = root->parent(); |
3477 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3468 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3478 } | 3469 } |
3479 } | 3470 } |
3480 | 3471 |
3481 #endif | 3472 #endif |
OLD | NEW |