Chromium Code Reviews| 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" | |
| 69 #include "core/rendering/RenderScrollbarPart.h" | 70 #include "core/rendering/RenderScrollbarPart.h" |
| 70 #include "core/rendering/RenderTableCaption.h" | 71 #include "core/rendering/RenderTableCaption.h" |
| 71 #include "core/rendering/RenderTableCell.h" | 72 #include "core/rendering/RenderTableCell.h" |
| 72 #include "core/rendering/RenderTableCol.h" | 73 #include "core/rendering/RenderTableCol.h" |
| 73 #include "core/rendering/RenderTableRow.h" | 74 #include "core/rendering/RenderTableRow.h" |
| 74 #include "core/rendering/RenderTheme.h" | 75 #include "core/rendering/RenderTheme.h" |
| 75 #include "core/rendering/RenderView.h" | 76 #include "core/rendering/RenderView.h" |
| 76 #include "core/rendering/compositing/CompositedLayerMapping.h" | 77 #include "core/rendering/compositing/CompositedLayerMapping.h" |
| 77 #include "core/rendering/compositing/RenderLayerCompositor.h" | 78 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 78 #include "core/rendering/style/ContentData.h" | 79 #include "core/rendering/style/ContentData.h" |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1433 { | 1434 { |
| 1434 if (!isRooted()) | 1435 if (!isRooted()) |
| 1435 return 0; | 1436 return 0; |
| 1436 | 1437 |
| 1437 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta iner()); | 1438 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta iner()); |
| 1438 } | 1439 } |
| 1439 | 1440 |
| 1440 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const | 1441 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const |
| 1441 { | 1442 { |
| 1442 RenderLayerModelObject* container = 0; | 1443 RenderLayerModelObject* container = 0; |
| 1443 if (view()->usesCompositing()) { | 1444 // FIXME: CompositingState is not necessarily up to date for many callers of this function. |
| 1444 // FIXME: CompositingState is not necessarily up to date for many caller s of this function. | 1445 DisableCompositingQueryAsserts disabler; |
| 1445 DisableCompositingQueryAsserts disabler; | |
| 1446 | 1446 |
| 1447 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForP aintInvalidation()) | 1447 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint InvalidationCrossingFrameBoundaries()) |
| 1448 container = compositingLayer->renderer(); | 1448 container = compositingLayer->renderer(); |
| 1449 } | |
| 1450 return container; | 1449 return container; |
| 1451 } | 1450 } |
| 1452 | 1451 |
| 1453 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA ncestors(const RenderLayerModelObject* paintInvalidationContainer) const | 1452 const RenderLayerModelObject* RenderObject::adjustCompositedContainerForSpecialA ncestors(const RenderLayerModelObject* paintInvalidationContainer) const |
| 1454 { | 1453 { |
| 1455 | 1454 |
| 1456 if (document().view()->hasSoftwareFilters()) { | 1455 if (document().view()->hasSoftwareFilters()) { |
| 1457 if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilte rLayer()) | 1456 if (RenderLayer* enclosingFilterLayer = enclosingLayer()->enclosingFilte rLayer()) |
| 1458 return enclosingFilterLayer->renderer(); | 1457 return enclosingFilterLayer->renderer(); |
| 1459 } | 1458 } |
| 1460 | 1459 |
| 1461 // If we have a flow thread, then we need to do individual paint invalidatio ns within the RenderRegions instead. | 1460 // 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 | 1461 // 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. | 1462 // paint invalidation to do individual region paint invalidations. |
| 1464 if (RenderFlowThread* parentRenderFlowThread = flowThreadContainingBlock()) { | 1463 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 | 1464 // 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. | 1465 // 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) | 1466 if (!paintInvalidationContainer || paintInvalidationContainer->flowThrea dContainingBlock() != parentRenderFlowThread) |
| 1468 paintInvalidationContainer = parentRenderFlowThread; | 1467 paintInvalidationContainer = parentRenderFlowThread; |
| 1469 } | 1468 } |
| 1470 return paintInvalidationContainer ? paintInvalidationContainer : view(); | 1469 |
| 1470 if (paintInvalidationContainer) | |
| 1471 return paintInvalidationContainer; | |
| 1472 | |
| 1473 RenderView* renderView = view(); | |
| 1474 while (renderView->frame()->ownerRenderer()) | |
| 1475 renderView = renderView->frame()->ownerRenderer()->view(); | |
|
leviw_travelin_and_unemployed
2014/08/19 18:47:06
To be clear, this means we're going to walk up all
chrishtr
2014/08/19 21:18:02
This code only executes in the situation when ther
| |
| 1476 return renderView; | |
| 1471 } | 1477 } |
| 1472 | 1478 |
| 1473 bool RenderObject::isPaintInvalidationContainer() const | 1479 bool RenderObject::isPaintInvalidationContainer() const |
| 1474 { | 1480 { |
| 1475 return hasLayer() && toRenderLayerModelObject(this)->layer()->isPaintInvalid ationContainer(); | 1481 return hasLayer() && toRenderLayerModelObject(this)->layer()->isPaintInvalid ationContainer(); |
| 1476 } | 1482 } |
| 1477 | 1483 |
| 1478 template <typename T> | 1484 template <typename T> |
| 1479 void addJsonObjectForRect(TracedValue* value, const char* name, const T& rect) | 1485 void addJsonObjectForRect(TracedValue* value, const char* name, const T& rect) |
| 1480 { | 1486 { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1519 if (paintInvalidationContainer->isRenderFlowThread()) { | 1525 if (paintInvalidationContainer->isRenderFlowThread()) { |
| 1520 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang leInRegions(r); | 1526 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang leInRegions(r); |
| 1521 return; | 1527 return; |
| 1522 } | 1528 } |
| 1523 | 1529 |
| 1524 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l ayer()->requiresFullLayerImageForFilters()) { | 1530 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l ayer()->requiresFullLayerImageForFilters()) { |
| 1525 paintInvalidationContainer->layer()->paintInvalidator().setFilterBackend NeedsPaintInvalidationInRect(r); | 1531 paintInvalidationContainer->layer()->paintInvalidator().setFilterBackend NeedsPaintInvalidationInRect(r); |
| 1526 return; | 1532 return; |
| 1527 } | 1533 } |
| 1528 | 1534 |
| 1529 RenderView* v = view(); | |
| 1530 if (paintInvalidationContainer->isRenderView()) { | 1535 if (paintInvalidationContainer->isRenderView()) { |
| 1531 ASSERT(paintInvalidationContainer == v); | 1536 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r) ; |
| 1532 v->invalidatePaintForRectangle(r); | |
| 1533 return; | 1537 return; |
| 1534 } | 1538 } |
| 1535 | 1539 |
| 1536 if (v->usesCompositing()) { | 1540 if (view()->usesCompositing()) { |
| 1537 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); | 1541 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); |
| 1538 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsP aintInvalidationInRect(r); | 1542 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsP aintInvalidationInRect(r); |
| 1539 } | 1543 } |
| 1540 } | 1544 } |
| 1541 | 1545 |
| 1542 void RenderObject::invalidatePaintForWholeRenderer() const | 1546 void RenderObject::invalidatePaintForWholeRenderer() const |
| 1543 { | 1547 { |
| 1544 if (!isRooted()) | 1548 if (!isRooted()) |
| 1545 return; | 1549 return; |
| 1546 | 1550 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1757 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); | 1761 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); |
| 1758 } | 1762 } |
| 1759 | 1763 |
| 1760 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval idationState* paintInvalidationState) const | 1764 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval idationState* paintInvalidationState) const |
| 1761 { | 1765 { |
| 1762 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai ner, paintInvalidationState)); | 1766 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai ner, paintInvalidationState)); |
| 1763 r.inflate(outlineWidth); | 1767 r.inflate(outlineWidth); |
| 1764 return r; | 1768 return r; |
| 1765 } | 1769 } |
| 1766 | 1770 |
| 1771 LayoutRect RenderObject::absoluteClippedOverflowRect() const | |
| 1772 { | |
| 1773 return clippedOverflowRectForPaintInvalidation(view()); | |
| 1774 } | |
| 1775 | |
| 1767 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject*, const PaintInvalidationState*) const | 1776 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject*, const PaintInvalidationState*) const |
| 1768 { | 1777 { |
| 1769 ASSERT_NOT_REACHED(); | 1778 ASSERT_NOT_REACHED(); |
| 1770 return LayoutRect(); | 1779 return LayoutRect(); |
| 1771 } | 1780 } |
| 1772 | 1781 |
| 1773 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec t* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition, co nst PaintInvalidationState* paintInvalidationState) const | 1782 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec t* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition, co nst PaintInvalidationState* paintInvalidationState) const |
| 1774 { | 1783 { |
| 1775 if (paintInvalidationContainer == this) | 1784 if (paintInvalidationContainer == this) |
| 1776 return; | 1785 return; |
| (...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3474 { | 3483 { |
| 3475 if (object1) { | 3484 if (object1) { |
| 3476 const blink::RenderObject* root = object1; | 3485 const blink::RenderObject* root = object1; |
| 3477 while (root->parent()) | 3486 while (root->parent()) |
| 3478 root = root->parent(); | 3487 root = root->parent(); |
| 3479 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3488 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3480 } | 3489 } |
| 3481 } | 3490 } |
| 3482 | 3491 |
| 3483 #endif | 3492 #endif |
| OLD | NEW |