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

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

Issue 270383002: Remove will-change: contents GPU rasterization hint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 } 652 }
653 653
654 bool RenderStyle::diffNeedsRecompositeLayer(const RenderStyle& other) const 654 bool RenderStyle::diffNeedsRecompositeLayer(const RenderStyle& other) const
655 { 655 {
656 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { 656 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
657 if (rareNonInheritedData->m_transformStyle3D != other.rareNonInheritedDa ta->m_transformStyle3D 657 if (rareNonInheritedData->m_transformStyle3D != other.rareNonInheritedDa ta->m_transformStyle3D
658 || rareNonInheritedData->m_backfaceVisibility != other.rareNonInheri tedData->m_backfaceVisibility 658 || rareNonInheritedData->m_backfaceVisibility != other.rareNonInheri tedData->m_backfaceVisibility
659 || rareNonInheritedData->m_perspective != other.rareNonInheritedData ->m_perspective 659 || rareNonInheritedData->m_perspective != other.rareNonInheritedData ->m_perspective
660 || rareNonInheritedData->m_perspectiveOriginX != other.rareNonInheri tedData->m_perspectiveOriginX 660 || rareNonInheritedData->m_perspectiveOriginX != other.rareNonInheri tedData->m_perspectiveOriginX
661 || rareNonInheritedData->m_perspectiveOriginY != other.rareNonInheri tedData->m_perspectiveOriginY 661 || rareNonInheritedData->m_perspectiveOriginY != other.rareNonInheri tedData->m_perspectiveOriginY
662 || hasWillChangeCompositingHint() != other.hasWillChangeCompositingH int() 662 || hasWillChangeCompositingHint() != other.hasWillChangeCompositingH int())
663 || hasWillChangeGpuRasterizationHint() != other.hasWillChangeGpuRast erizationHint())
664 return true; 663 return true;
665 } 664 }
666 665
667 return false; 666 return false;
668 } 667 }
669 668
670 unsigned RenderStyle::computeChangedContextSensitiveProperties(const RenderStyle & other, StyleDifference diff) const 669 unsigned RenderStyle::computeChangedContextSensitiveProperties(const RenderStyle & other, StyleDifference diff) const
671 { 670 {
672 unsigned changedContextSensitiveProperties = ContextSensitivePropertyNone; 671 unsigned changedContextSensitiveProperties = ContextSensitivePropertyNone;
673 672
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 case CSSPropertyBottom: 875 case CSSPropertyBottom:
877 case CSSPropertyWebkitFilter: 876 case CSSPropertyWebkitFilter:
878 return true; 877 return true;
879 default: 878 default:
880 break; 879 break;
881 } 880 }
882 } 881 }
883 return false; 882 return false;
884 } 883 }
885 884
886 bool RenderStyle::hasWillChangeGpuRasterizationHint() const
887 {
888 if (willChangeContents())
889 return true;
890
891 for (size_t i = 0; i < rareNonInheritedData->m_willChange->m_properties.size (); ++i) {
892 switch (rareNonInheritedData->m_willChange->m_properties[i]) {
893 case CSSPropertyWidth:
894 case CSSPropertyHeight:
895 case CSSPropertyBackgroundColor:
896 case CSSPropertyBackgroundPosition:
897 return true;
898 default:
899 break;
900 }
901 }
902 return false;
903 }
904
905 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr ansformOperations, RenderStyle::ApplyTransformOrigin applyOrigin) 885 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr ansformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
906 { 886 {
907 // transform-origin brackets the transform with translate operations. 887 // transform-origin brackets the transform with translate operations.
908 // Optimize for the case where the only transform is a translation, since th e transform-origin is irrelevant 888 // Optimize for the case where the only transform is a translation, since th e transform-origin is irrelevant
909 // in that case. 889 // in that case.
910 if (applyOrigin != RenderStyle::IncludeTransformOrigin) 890 if (applyOrigin != RenderStyle::IncludeTransformOrigin)
911 return false; 891 return false;
912 892
913 unsigned size = transformOperations.size(); 893 unsigned size = transformOperations.size();
914 for (unsigned i = 0; i < size; ++i) { 894 for (unsigned i = 0; i < size; ++i) {
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 // right 1652 // right
1673 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1653 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1674 if (radiiSum > rect.height()) 1654 if (radiiSum > rect.height())
1675 factor = std::min(rect.height() / radiiSum, factor); 1655 factor = std::min(rect.height() / radiiSum, factor);
1676 1656
1677 ASSERT(factor <= 1); 1657 ASSERT(factor <= 1);
1678 return factor; 1658 return factor;
1679 } 1659 }
1680 1660
1681 } // namespace WebCore 1661 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698