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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 240253007: Don't always repaint on zIndex change (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 return StyleDifferenceLayout; 598 return StyleDifferenceLayout;
599 } 599 }
600 600
601 StyleDifferenceLegacy repaintDifference = repaintOnlyDiff(other, changedCont extSensitiveProperties); 601 StyleDifferenceLegacy repaintDifference = repaintOnlyDiff(other, changedCont extSensitiveProperties);
602 ASSERT(repaintDifference <= StyleDifferenceRepaintLayer); 602 ASSERT(repaintDifference <= StyleDifferenceRepaintLayer);
603 return repaintDifference; 603 return repaintDifference;
604 } 604 }
605 605
606 StyleDifferenceLegacy RenderStyle::repaintOnlyDiff(const RenderStyle& other, uns igned& changedContextSensitiveProperties) const 606 StyleDifferenceLegacy RenderStyle::repaintOnlyDiff(const RenderStyle& other, uns igned& changedContextSensitiveProperties) const
607 { 607 {
608 if (position() != StaticPosition && (m_box->zIndex() != other.m_box->zIndex( ) || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex() 608 // FIXME: The condition for zIndex may be incorrect or unnecessary.
609 || visual->clip != other.visual->clip || visual->hasClip != other.visual ->hasClip)) 609 // See StyleAdjuster::adjustRenderStyle() for the conditions that zIndex is applicable.
610 return StyleDifferenceRepaintLayer; 610 if (position() != StaticPosition) {
611 if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() ! = other.m_box->hasAutoZIndex())
612 changedContextSensitiveProperties |= ContextSensitivePropertyZIndex;
613 if (visual->clip != other.visual->clip || visual->hasClip != other.visua l->hasClip)
614 return StyleDifferenceRepaintLayer;
615 }
611 616
612 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData ->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode 617 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData ->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode
613 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is olation)) 618 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is olation))
614 return StyleDifferenceRepaintLayer; 619 return StyleDifferenceRepaintLayer;
615 620
616 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) { 621 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) {
617 // Don't return early here; instead take note of the type of change, 622 // Don't return early here; instead take note of the type of change,
618 // and deal with it when looking at compositing. 623 // and deal with it when looking at compositing.
619 changedContextSensitiveProperties |= ContextSensitivePropertyOpacity; 624 changedContextSensitiveProperties |= ContextSensitivePropertyOpacity;
620 } 625 }
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 // right 1652 // right
1648 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1653 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1649 if (radiiSum > rect.height()) 1654 if (radiiSum > rect.height())
1650 factor = std::min(rect.height() / radiiSum, factor); 1655 factor = std::min(rect.height() / radiiSum, factor);
1651 1656
1652 ASSERT(factor <= 1); 1657 ASSERT(factor <= 1);
1653 return factor; 1658 return factor;
1654 } 1659 }
1655 1660
1656 } // namespace WebCore 1661 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/style/RenderStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698