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