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

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

Issue 381473002: Use reference for FillLayer if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/style/RenderStyle.h ('k') | no next file » | 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 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 RoundedRect roundedRect(pixelSnappedIntRect(innerRect)); 1005 RoundedRect roundedRect(pixelSnappedIntRect(innerRect));
1006 1006
1007 if (hasBorderRadius()) { 1007 if (hasBorderRadius()) {
1008 RoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii(); 1008 RoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii();
1009 radii.shrink(topWidth, bottomWidth, leftWidth, rightWidth); 1009 radii.shrink(topWidth, bottomWidth, leftWidth, rightWidth);
1010 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includ eLogicalLeftEdge, includeLogicalRightEdge); 1010 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includ eLogicalLeftEdge, includeLogicalRightEdge);
1011 } 1011 }
1012 return roundedRect; 1012 return roundedRect;
1013 } 1013 }
1014 1014
1015 static bool allLayersAreFixed(const FillLayer* layer) 1015 static bool allLayersAreFixed(const FillLayer& layer)
1016 { 1016 {
1017 bool allFixed = true; 1017 for (const FillLayer* currLayer = &layer; currLayer; currLayer = currLayer-> next()) {
1018 if (!currLayer->image() || currLayer->attachment() != FixedBackgroundAtt achment)
1019 return false;
1020 }
1018 1021
1019 for (const FillLayer* currLayer = layer; currLayer; currLayer = currLayer->n ext()) 1022 return true;
1020 allFixed &= (currLayer->image() && currLayer->attachment() == FixedBackg roundAttachment);
1021
1022 return layer && allFixed;
1023 } 1023 }
1024 1024
1025 bool RenderStyle::hasEntirelyFixedBackground() const 1025 bool RenderStyle::hasEntirelyFixedBackground() const
1026 { 1026 {
1027 return allLayersAreFixed(backgroundLayers()); 1027 return allLayersAreFixed(backgroundLayers());
1028 } 1028 }
1029 1029
1030 const CounterDirectiveMap* RenderStyle::counterDirectives() const 1030 const CounterDirectiveMap* RenderStyle::counterDirectives() const
1031 { 1031 {
1032 return rareNonInheritedData->m_counterDirectives.get(); 1032 return rareNonInheritedData->m_counterDirectives.get();
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 // right 1687 // right
1688 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1688 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1689 if (radiiSum > rect.height()) 1689 if (radiiSum > rect.height())
1690 factor = std::min(rect.height() / radiiSum, factor); 1690 factor = std::min(rect.height() / radiiSum, factor);
1691 1691
1692 ASSERT(factor <= 1); 1692 ASSERT(factor <= 1);
1693 return factor; 1693 return factor;
1694 } 1694 }
1695 1695
1696 } // namespace WebCore 1696 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698