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

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

Issue 175263002: Implement will-change-based creation of layers, stacking contexts, and containing blocks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Always create a stacking context for will-change:position Created 6 years, 10 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 return StyleDifferenceRepaint; 643 return StyleDifferenceRepaint;
644 644
645 if (rareNonInheritedData->m_clipPath != other->rareNonInheritedData->m_c lipPath) 645 if (rareNonInheritedData->m_clipPath != other->rareNonInheritedData->m_c lipPath)
646 return StyleDifferenceRepaint; 646 return StyleDifferenceRepaint;
647 647
648 if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { 648 if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) {
649 if (rareNonInheritedData->m_transformStyle3D != other->rareNonInheritedD ata->m_transformStyle3D 649 if (rareNonInheritedData->m_transformStyle3D != other->rareNonInheritedD ata->m_transformStyle3D
650 || rareNonInheritedData->m_backfaceVisibility != other->rareNonInher itedData->m_backfaceVisibility 650 || rareNonInheritedData->m_backfaceVisibility != other->rareNonInher itedData->m_backfaceVisibility
651 || rareNonInheritedData->m_perspective != other->rareNonInheritedDat a->m_perspective 651 || rareNonInheritedData->m_perspective != other->rareNonInheritedDat a->m_perspective
652 || rareNonInheritedData->m_perspectiveOriginX != other->rareNonInher itedData->m_perspectiveOriginX 652 || rareNonInheritedData->m_perspectiveOriginX != other->rareNonInher itedData->m_perspectiveOriginX
653 || rareNonInheritedData->m_perspectiveOriginY != other->rareNonInher itedData->m_perspectiveOriginY) 653 || rareNonInheritedData->m_perspectiveOriginY != other->rareNonInher itedData->m_perspectiveOriginY
654 || hasWillChangeCompositingHint() != other->hasWillChangeCompositing Hint())
654 return StyleDifferenceRecompositeLayer; 655 return StyleDifferenceRecompositeLayer;
655 } 656 }
656 657
657 if (inherited->color != other->inherited->color 658 if (inherited->color != other->inherited->color
658 || inherited_flags._text_decorations != other->inherited_flags._text_dec orations 659 || inherited_flags._text_decorations != other->inherited_flags._text_dec orations
659 || visual->textDecoration != other->visual->textDecoration 660 || visual->textDecoration != other->visual->textDecoration
660 || rareNonInheritedData->m_textDecorationStyle != other->rareNonInherite dData->m_textDecorationStyle 661 || rareNonInheritedData->m_textDecorationStyle != other->rareNonInherite dData->m_textDecorationStyle
661 || rareNonInheritedData->m_textDecorationColor != other->rareNonInherite dData->m_textDecorationColor 662 || rareNonInheritedData->m_textDecorationColor != other->rareNonInherite dData->m_textDecorationColor
662 || rareInheritedData->textFillColor != other->rareInheritedData->textFil lColor 663 || rareInheritedData->textFillColor != other->rareInheritedData->textFil lColor
663 || rareInheritedData->textStrokeColor != other->rareInheritedData->textS trokeColor 664 || rareInheritedData->textStrokeColor != other->rareInheritedData->textS trokeColor
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 rareNonInheritedData.access()->m_isolation = v; 825 rareNonInheritedData.access()->m_isolation = v;
825 } 826 }
826 827
827 bool RenderStyle::hasIsolation() const 828 bool RenderStyle::hasIsolation() const
828 { 829 {
829 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 830 if (RuntimeEnabledFeatures::cssCompositingEnabled())
830 return rareNonInheritedData->m_isolation != IsolationAuto; 831 return rareNonInheritedData->m_isolation != IsolationAuto;
831 return false; 832 return false;
832 } 833 }
833 834
835 bool RenderStyle::hasWillChangeCompositingHint() const
836 {
837 for (size_t i = 0; i < rareNonInheritedData->m_willChange->m_properties.size (); ++i) {
838 switch (rareNonInheritedData->m_willChange->m_properties[i]) {
839 case CSSPropertyOpacity:
840 case CSSPropertyWebkitTransform:
841 case CSSPropertyLeft:
842 case CSSPropertyTop:
843 case CSSPropertyRight:
844 case CSSPropertyBottom:
845 case CSSPropertyWebkitFilter:
846 return true;
847 default:
848 break;
849 }
850 }
851 return false;
852 }
853
834 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr ansformOperations, RenderStyle::ApplyTransformOrigin applyOrigin) 854 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr ansformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
835 { 855 {
836 // transform-origin brackets the transform with translate operations. 856 // transform-origin brackets the transform with translate operations.
837 // Optimize for the case where the only transform is a translation, since th e transform-origin is irrelevant 857 // Optimize for the case where the only transform is a translation, since th e transform-origin is irrelevant
838 // in that case. 858 // in that case.
839 if (applyOrigin != RenderStyle::IncludeTransformOrigin) 859 if (applyOrigin != RenderStyle::IncludeTransformOrigin)
840 return false; 860 return false;
841 861
842 unsigned size = transformOperations.size(); 862 unsigned size = transformOperations.size();
843 for (unsigned i = 0; i < size; ++i) { 863 for (unsigned i = 0; i < size; ++i) {
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 } 1619 }
1600 1620
1601 void RenderStyle::setBorderImageOutset(const BorderImageLengthBox& outset) 1621 void RenderStyle::setBorderImageOutset(const BorderImageLengthBox& outset)
1602 { 1622 {
1603 if (surround->border.m_image.outset() == outset) 1623 if (surround->border.m_image.outset() == outset)
1604 return; 1624 return;
1605 surround.access()->border.m_image.setOutset(outset); 1625 surround.access()->border.m_image.setOutset(outset);
1606 } 1626 }
1607 1627
1608 } // namespace WebCore 1628 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698