Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 482063005: Allow paint invalidation containers to cross frame boundaries. (re-land #2) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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();
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
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 if (paintInvalidationContainer->view()->usesCompositing()) {
1536 if (v->usesCompositing()) {
1537 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); 1540 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo ntainer->layer()->compositingState() == PaintsIntoGroupedBacking));
1538 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsP aintInvalidationInRect(r); 1541 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsP aintInvalidationInRect(r);
1539 } 1542 }
1540 } 1543 }
1541 1544
1542 void RenderObject::invalidatePaintForWholeRenderer() const 1545 void RenderObject::invalidatePaintForWholeRenderer() const
1543 { 1546 {
1544 if (!isRooted()) 1547 if (!isRooted())
1545 return; 1548 return;
1546 1549
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); 1760 return !document().view()->needsFullPaintInvalidation() && everHadLayout();
1758 } 1761 }
1759 1762
1760 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval idationState* paintInvalidationState) const 1763 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval idationState* paintInvalidationState) const
1761 { 1764 {
1762 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai ner, paintInvalidationState)); 1765 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai ner, paintInvalidationState));
1763 r.inflate(outlineWidth); 1766 r.inflate(outlineWidth);
1764 return r; 1767 return r;
1765 } 1768 }
1766 1769
1770 LayoutRect RenderObject::absoluteClippedOverflowRect() const
1771 {
1772 return clippedOverflowRectForPaintInvalidation(view());
1773 }
1774
1767 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject*, const PaintInvalidationState*) const 1775 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject*, const PaintInvalidationState*) const
1768 { 1776 {
1769 ASSERT_NOT_REACHED(); 1777 ASSERT_NOT_REACHED();
1770 return LayoutRect(); 1778 return LayoutRect();
1771 } 1779 }
1772 1780
1773 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec t* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition, co nst PaintInvalidationState* paintInvalidationState) const 1781 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec t* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition, co nst PaintInvalidationState* paintInvalidationState) const
1774 { 1782 {
1775 if (paintInvalidationContainer == this) 1783 if (paintInvalidationContainer == this)
1776 return; 1784 return;
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
3474 { 3482 {
3475 if (object1) { 3483 if (object1) {
3476 const blink::RenderObject* root = object1; 3484 const blink::RenderObject* root = object1;
3477 while (root->parent()) 3485 while (root->parent())
3478 root = root->parent(); 3486 root = root->parent();
3479 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3487 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3480 } 3488 }
3481 } 3489 }
3482 3490
3483 #endif 3491 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698