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

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

Issue 535633002: Common invalidateTreeIfNeeded() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove the ASSERT Created 6 years, 3 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
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayerModelObject.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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 if (curLayer->image() && image == curLayer->image()->data() && curLayer- >image()->canRender(*this, style()->effectiveZoom())) { 1509 if (curLayer->image() && image == curLayer->image()->data() && curLayer- >image()->canRender(*this, style()->effectiveZoom())) {
1510 layerRenderer->setShouldDoFullPaintInvalidation(true); 1510 layerRenderer->setShouldDoFullPaintInvalidation(true);
1511 return true; 1511 return true;
1512 } 1512 }
1513 } 1513 }
1514 return false; 1514 return false;
1515 } 1515 }
1516 1516
1517 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo ntainer) 1517 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo ntainer)
1518 { 1518 {
1519 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
1520 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer();
1521 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState));
1522 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState));
1523
1524 InvalidationReason reason = InvalidationNone;
1525
1526 // If we are set to do a full paint invalidation that means the RenderView w ill be 1519 // If we are set to do a full paint invalidation that means the RenderView w ill be
1527 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child 1520 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child
1528 // renderers as they'll be covered by the RenderView. 1521 // renderers as they'll be covered by the RenderView.
1529 if (!view()->doingFullPaintInvalidation()) { 1522 if (!view()->doingFullPaintInvalidation()) {
1530 if ((onlyNeededPositionedMovementLayout() && compositingState() != Paint sIntoOwnBacking) 1523 if ((onlyNeededPositionedMovementLayout() && compositingState() != Paint sIntoOwnBacking)
1531 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() 1524 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
1532 && hasLayer() 1525 && hasLayer()
1533 && layer()->isSelfPaintingLayer())) { 1526 && layer()->isSelfPaintingLayer())) {
1534 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); 1527 setShouldDoFullPaintInvalidation(true, MarkOnlyThis);
1535 } 1528 }
1529 }
1536 1530
1537 reason = RenderObject::invalidatePaintIfNeeded(newPaintInvalidationConta iner, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paint InvalidationState); 1531 InvalidationReason reason = RenderBoxModelObject::invalidatePaintIfNeeded(pa intInvalidationState, newPaintInvalidationContainer);
1532
1533 if (!view()->doingFullPaintInvalidation()) {
1538 if (reason == InvalidationNone || reason == InvalidationIncremental) 1534 if (reason == InvalidationNone || reason == InvalidationIncremental)
1539 invalidatePaintForOverflowIfNeeded(); 1535 invalidatePaintForOverflowIfNeeded();
1540 1536
1541 // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer. 1537 // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer.
1542 if (ScrollableArea* area = scrollableArea()) { 1538 if (ScrollableArea* area = scrollableArea()) {
1543 if (area->hasVerticalBarDamage()) 1539 if (area->hasVerticalBarDamage())
1544 invalidatePaintRectangle(area->verticalBarDamage()); 1540 invalidatePaintRectangle(area->verticalBarDamage());
1545 if (area->hasHorizontalBarDamage()) 1541 if (area->hasHorizontalBarDamage())
1546 invalidatePaintRectangle(area->horizontalBarDamage()); 1542 invalidatePaintRectangle(area->horizontalBarDamage());
1547 } 1543 }
(...skipping 3202 matching lines...) Expand 10 before | Expand all | Expand 10 after
4750 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4746 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4751 { 4747 {
4752 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); 4748 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
4753 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4749 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4754 ASSERT(hasBackground == style.hasBackground()); 4750 ASSERT(hasBackground == style.hasBackground());
4755 hasBorder = style.hasBorder(); 4751 hasBorder = style.hasBorder();
4756 hasAppearance = style.hasAppearance(); 4752 hasAppearance = style.hasAppearance();
4757 } 4753 }
4758 4754
4759 } // namespace blink 4755 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayerModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698