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

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

Issue 433603004: Disentangle repaint-after-compositing from updateLayerPositionsAfterLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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.cpp » ('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 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali dationState) 1550 void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali dationState)
1551 { 1551 {
1552 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally , RenderBlockFlows with 1552 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally , RenderBlockFlows with
1553 // inline children should track a dirty rect in local coordinates for dirty lines instead of invalidating 1553 // inline children should track a dirty rect in local coordinates for dirty lines instead of invalidating
1554 // the world. 1554 // the world.
1555 // FIXME: We should still be recursing through inline's children, as they ca n have boxes, but we don't 1555 // FIXME: We should still be recursing through inline's children, as they ca n have boxes, but we don't
1556 // appear to have tests for this? 1556 // appear to have tests for this?
1557 // FIXME: SVG should probably also go through this unified paint invalidatio n system. 1557 // FIXME: SVG should probably also go through this unified paint invalidatio n system.
1558 ASSERT(!needsLayout()); 1558 ASSERT(!needsLayout());
1559 1559
1560 if (!shouldCheckForPaintInvalidation()) 1560 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
1561 return; 1561 return;
1562 1562
1563 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer (); 1563 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer ();
1564 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); 1564 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
1565 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); 1565 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation());
1566 1566
1567 invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContaine r); 1567 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
1568 1568
1569 // This is for the next invalidatePaintIfNeeded so must be after invalidateP aintIfNeeded. 1569 // This is for the next invalidatePaintIfNeeded so must be after invalidateP aintIfNeeded.
1570 savePreviousBorderBoxSizeIfNeeded(); 1570 savePreviousBorderBoxSizeIfNeeded();
1571 1571
1572 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer); 1572 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
1573 if (reason == InvalidationLocationChange || reason == InvalidationFull)
1574 childTreeWalkState.setForceCheckForPaintInvalidation();
1573 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); 1575 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
1574 } 1576 }
1575 1577
1576 void RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval idationState, const RenderLayerModelObject& newPaintInvalidationContainer) 1578 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo ntainer)
1577 { 1579 {
1578 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); 1580 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
1579 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); 1581 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer();
1580 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); 1582 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState));
1581 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); 1583 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState));
1582 1584
1583 // If we are set to do a full paint invalidation that means the RenderView w ill be 1585 // If we are set to do a full paint invalidation that means the RenderView w ill be
1584 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child 1586 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child
1585 // renderers as they'll be covered by the RenderView. 1587 // renderers as they'll be covered by the RenderView.
1586 if (view()->doingFullPaintInvalidation()) 1588 if (view()->doingFullPaintInvalidation())
1587 return; 1589 return InvalidationNone;
1588 1590
1589 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) 1591 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking)
1590 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() 1592 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
1591 && hasLayer() 1593 && hasLayer()
1592 && layer()->isSelfPaintingLayer())) { 1594 && layer()->isSelfPaintingLayer())) {
1593 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); 1595 setShouldDoFullPaintInvalidation(true, MarkOnlyThis);
1594 } 1596 }
1595 1597
1596 if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, ol dPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalida tionState)) 1598 InvalidationReason reason = RenderObject::invalidatePaintIfNeeded(newPaintIn validationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationC ontainer, paintInvalidationState);
1599 if (reason == InvalidationNone || reason == InvalidationIncremental)
1597 invalidatePaintForOverflowIfNeeded(); 1600 invalidatePaintForOverflowIfNeeded();
1598 1601
1599 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer. 1602 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer.
1600 if (ScrollableArea* area = scrollableArea()) { 1603 if (ScrollableArea* area = scrollableArea()) {
1601 if (area->hasVerticalBarDamage()) 1604 if (area->hasVerticalBarDamage())
1602 invalidatePaintRectangle(area->verticalBarDamage()); 1605 invalidatePaintRectangle(area->verticalBarDamage());
1603 if (area->hasHorizontalBarDamage()) 1606 if (area->hasHorizontalBarDamage())
1604 invalidatePaintRectangle(area->horizontalBarDamage()); 1607 invalidatePaintRectangle(area->horizontalBarDamage());
1605 } 1608 }
1609 return reason;
1606 } 1610 }
1607 1611
1608 void RenderBox::clearPaintInvalidationState() 1612 void RenderBox::clearPaintInvalidationState(const PaintInvalidationState& paintI nvalidationState)
1609 { 1613 {
1610 RenderBoxModelObject::clearPaintInvalidationState(); 1614 RenderBoxModelObject::clearPaintInvalidationState(paintInvalidationState);
1611 1615
1612 if (ScrollableArea* area = scrollableArea()) 1616 if (ScrollableArea* area = scrollableArea())
1613 area->resetScrollbarDamage(); 1617 area->resetScrollbarDamage();
1614 } 1618 }
1615 1619
1616 #if ENABLE(ASSERT) 1620 #if ENABLE(ASSERT)
1617 bool RenderBox::paintInvalidationStateIsDirty() const 1621 bool RenderBox::paintInvalidationStateIsDirty() const
1618 { 1622 {
1619 if (ScrollableArea* area = scrollableArea()) { 1623 if (ScrollableArea* area = scrollableArea()) {
1620 if (area->hasVerticalBarDamage() || area->hasHorizontalBarDamage()) 1624 if (area->hasVerticalBarDamage() || area->hasHorizontalBarDamage())
(...skipping 3101 matching lines...) Expand 10 before | Expand all | Expand 10 after
4722 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4726 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4723 { 4727 {
4724 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); 4728 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
4725 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4729 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4726 ASSERT(hasBackground == style.hasBackground()); 4730 ASSERT(hasBackground == style.hasBackground());
4727 hasBorder = style.hasBorder(); 4731 hasBorder = style.hasBorder();
4728 hasAppearance = style.hasAppearance(); 4732 hasAppearance = style.hasAppearance();
4729 } 4733 }
4730 4734
4731 } // namespace blink 4735 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698