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

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

Issue 434453002: Promote inlines to first-class invalidation citizens (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: This is up to date... 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/RenderBox.h ('k') | Source/core/rendering/RenderInline.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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 } 1536 }
1537 1537
1538 layerRenderer->invalidatePaintRectangle(geometry.destRect()); 1538 layerRenderer->invalidatePaintRectangle(geometry.destRect());
1539 if (geometry.destRect() == rendererRect) 1539 if (geometry.destRect() == rendererRect)
1540 return true; 1540 return true;
1541 } 1541 }
1542 } 1542 }
1543 return false; 1543 return false;
1544 } 1544 }
1545 1545
1546 void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali dationState)
1547 {
1548 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally , RenderBlockFlows with
1549 // inline children should track a dirty rect in local coordinates for dirty lines instead of invalidating
1550 // the world.
1551 // FIXME: We should still be recursing through inline's children, as they ca n have boxes, but we don't
1552 // appear to have tests for this?
1553 // FIXME: SVG should probably also go through this unified paint invalidatio n system.
1554 ASSERT(!needsLayout());
1555
1556 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
1557 return;
1558
1559 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer ();
1560 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
1561 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
1562
1563 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
1564
1565 // This is for the next invalidatePaintIfNeeded so must be after invalidateP aintIfNeeded.
1566 savePreviousBorderBoxSizeIfNeeded();
1567
1568 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
1569 if (reason == InvalidationLocationChange || reason == InvalidationFull)
1570 childTreeWalkState.setForceCheckForPaintInvalidation();
1571 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
1572 }
1573
1574 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo ntainer) 1546 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo ntainer)
1575 { 1547 {
1576 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); 1548 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
1577 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); 1549 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer();
1578 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); 1550 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState));
1579 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); 1551 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState));
1580 1552
1553 InvalidationReason reason = InvalidationNone;
1554
1581 // If we are set to do a full paint invalidation that means the RenderView w ill be 1555 // If we are set to do a full paint invalidation that means the RenderView w ill be
1582 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child 1556 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child
1583 // renderers as they'll be covered by the RenderView. 1557 // renderers as they'll be covered by the RenderView.
1584 if (view()->doingFullPaintInvalidation()) 1558 if (!view()->doingFullPaintInvalidation()) {
1585 return InvalidationNone; 1559 if ((onlyNeededPositionedMovementLayout() && compositingState() != Paint sIntoOwnBacking)
1560 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
1561 && hasLayer()
1562 && layer()->isSelfPaintingLayer())) {
1563 setShouldDoFullPaintInvalidation(true, MarkOnlyThis);
1564 }
1586 1565
1587 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) 1566 reason = RenderObject::invalidatePaintIfNeeded(newPaintInvalidationConta iner, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paint InvalidationState);
1588 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() 1567 if (reason == InvalidationNone || reason == InvalidationIncremental)
1589 && hasLayer() 1568 invalidatePaintForOverflowIfNeeded();
1590 && layer()->isSelfPaintingLayer())) { 1569
1591 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); 1570 // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer.
1571 if (ScrollableArea* area = scrollableArea()) {
1572 if (area->hasVerticalBarDamage())
1573 invalidatePaintRectangle(area->verticalBarDamage());
1574 if (area->hasHorizontalBarDamage())
1575 invalidatePaintRectangle(area->horizontalBarDamage());
1576 }
1592 } 1577 }
1593 1578
1594 InvalidationReason reason = RenderObject::invalidatePaintIfNeeded(newPaintIn validationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationC ontainer, paintInvalidationState); 1579 // This is for the next invalidatePaintIfNeeded so must be at the end.
1595 if (reason == InvalidationNone || reason == InvalidationIncremental) 1580 savePreviousBorderBoxSizeIfNeeded();
1596 invalidatePaintForOverflowIfNeeded();
1597
1598 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer.
1599 if (ScrollableArea* area = scrollableArea()) {
1600 if (area->hasVerticalBarDamage())
1601 invalidatePaintRectangle(area->verticalBarDamage());
1602 if (area->hasHorizontalBarDamage())
1603 invalidatePaintRectangle(area->horizontalBarDamage());
1604 }
1605 return reason; 1581 return reason;
1606 } 1582 }
1607 1583
1608 void RenderBox::clearPaintInvalidationState(const PaintInvalidationState& paintI nvalidationState) 1584 void RenderBox::clearPaintInvalidationState(const PaintInvalidationState& paintI nvalidationState)
1609 { 1585 {
1610 RenderBoxModelObject::clearPaintInvalidationState(paintInvalidationState); 1586 RenderBoxModelObject::clearPaintInvalidationState(paintInvalidationState);
1611 1587
1612 if (ScrollableArea* area = scrollableArea()) 1588 if (ScrollableArea* area = scrollableArea())
1613 area->resetScrollbarDamage(); 1589 area->resetScrollbarDamage();
1614 } 1590 }
(...skipping 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after
4722 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4698 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4723 { 4699 {
4724 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); 4700 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
4725 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4701 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4726 ASSERT(hasBackground == style.hasBackground()); 4702 ASSERT(hasBackground == style.hasBackground());
4727 hasBorder = style.hasBorder(); 4703 hasBorder = style.hasBorder();
4728 hasAppearance = style.hasAppearance(); 4704 hasAppearance = style.hasAppearance();
4729 } 4705 }
4730 4706
4731 } // namespace blink 4707 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698