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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSGradientValue.cpp

Issue 1447273003: Make the FloatSize constructor from an IntSize explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2015 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 secondRadius.setWidth(resolveRadius(m_endHorizontalSize.get(), conversio nData, &width)); 1125 secondRadius.setWidth(resolveRadius(m_endHorizontalSize.get(), conversio nData, &width));
1126 secondRadius.setHeight(m_endVerticalSize 1126 secondRadius.setHeight(m_endVerticalSize
1127 ? resolveRadius(m_endVerticalSize.get(), conversionData, &height) 1127 ? resolveRadius(m_endVerticalSize.get(), conversionData, &height)
1128 : secondRadius.width()); 1128 : secondRadius.width());
1129 } else { 1129 } else {
1130 EndShapeType shape = (m_shape && m_shape->getValueID() == CSSValueCircle ) || 1130 EndShapeType shape = (m_shape && m_shape->getValueID() == CSSValueCircle ) ||
1131 (!m_shape && !m_sizingBehavior && m_endHorizontalSize && !m_endVerti calSize) 1131 (!m_shape && !m_sizingBehavior && m_endHorizontalSize && !m_endVerti calSize)
1132 ? CircleEndShape 1132 ? CircleEndShape
1133 : EllipseEndShape; 1133 : EllipseEndShape;
1134 1134
1135 FloatSize floatSize(size);
1135 switch (m_sizingBehavior ? m_sizingBehavior->getValueID() : 0) { 1136 switch (m_sizingBehavior ? m_sizingBehavior->getValueID() : 0) {
1136 case CSSValueContain: 1137 case CSSValueContain:
1137 case CSSValueClosestSide: 1138 case CSSValueClosestSide:
1138 secondRadius = radiusToSide(secondPoint, size, shape, 1139 secondRadius = radiusToSide(secondPoint, floatSize, shape,
1139 [] (float a, float b) { return a < b; }); 1140 [] (float a, float b) { return a < b; });
1140 break; 1141 break;
1141 case CSSValueFarthestSide: 1142 case CSSValueFarthestSide:
1142 secondRadius = radiusToSide(secondPoint, size, shape, 1143 secondRadius = radiusToSide(secondPoint, floatSize, shape,
1143 [] (float a, float b) { return a > b; }); 1144 [] (float a, float b) { return a > b; });
1144 break; 1145 break;
1145 case CSSValueClosestCorner: 1146 case CSSValueClosestCorner:
1146 secondRadius = radiusToCorner(secondPoint, size, shape, 1147 secondRadius = radiusToCorner(secondPoint, floatSize, shape,
1147 [] (float a, float b) { return a < b; }); 1148 [] (float a, float b) { return a < b; });
1148 break; 1149 break;
1149 default: 1150 default:
1150 secondRadius = radiusToCorner(secondPoint, size, shape, 1151 secondRadius = radiusToCorner(secondPoint, floatSize, shape,
1151 [] (float a, float b) { return a > b; }); 1152 [] (float a, float b) { return a > b; });
1152 break; 1153 break;
1153 } 1154 }
1154 } 1155 }
1155 1156
1156 bool isDegenerate = !secondRadius.width() || !secondRadius.height(); 1157 bool isDegenerate = !secondRadius.width() || !secondRadius.height();
1157 RefPtr<Gradient> gradient = Gradient::create(firstPoint, firstRadius, second Point, 1158 RefPtr<Gradient> gradient = Gradient::create(firstPoint, firstRadius, second Point,
1158 isDegenerate ? 0 : secondRadius.width(), isDegenerate ? 1 : secondRadius .aspectRatio()); 1159 isDegenerate ? 0 : secondRadius.width(), isDegenerate ? 1 : secondRadius .aspectRatio());
1159 1160
1160 gradient->setSpreadMethod(m_repeating ? SpreadMethodRepeat : SpreadMethodPad ); 1161 gradient->setSpreadMethod(m_repeating ? SpreadMethodRepeat : SpreadMethodPad );
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 visitor->trace(m_firstRadius); 1218 visitor->trace(m_firstRadius);
1218 visitor->trace(m_secondRadius); 1219 visitor->trace(m_secondRadius);
1219 visitor->trace(m_shape); 1220 visitor->trace(m_shape);
1220 visitor->trace(m_sizingBehavior); 1221 visitor->trace(m_sizingBehavior);
1221 visitor->trace(m_endHorizontalSize); 1222 visitor->trace(m_endHorizontalSize);
1222 visitor->trace(m_endVerticalSize); 1223 visitor->trace(m_endVerticalSize);
1223 CSSGradientValue::traceAfterDispatch(visitor); 1224 CSSGradientValue::traceAfterDispatch(visitor);
1224 } 1225 }
1225 1226
1226 } // namespace blink 1227 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698