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

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

Issue 2754783003: Remove two Gradient setters (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceLinearGradient.cpp » ('j') | 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) 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 if (m_firstY) 871 if (m_firstY)
872 firstPoint.setY(size.height() - secondPoint.y()); 872 firstPoint.setY(size.height() - secondPoint.y());
873 } else 873 } else
874 secondPoint.setY(size.height()); 874 secondPoint.setY(size.height());
875 break; 875 break;
876 default: 876 default:
877 ASSERT_NOT_REACHED(); 877 ASSERT_NOT_REACHED();
878 } 878 }
879 } 879 }
880 880
881 RefPtr<Gradient> gradient = Gradient::create(firstPoint, secondPoint); 881 RefPtr<Gradient> gradient =
882 882 Gradient::create(firstPoint, secondPoint,
883 gradient->setSpreadMethod(m_repeating ? SpreadMethodRepeat : SpreadMethodPad); 883 m_repeating ? SpreadMethodRepeat : SpreadMethodPad,
884 gradient->setDrawsInPMColorSpace(true); 884 Gradient::ColorInterpolation::Premultiplied);
885 885
886 // Now add the stops. 886 // Now add the stops.
887 addStops(gradient.get(), conversionData, object); 887 addStops(gradient.get(), conversionData, object);
888 888
889 return gradient.release(); 889 return gradient.release();
890 } 890 }
891 891
892 bool CSSLinearGradientValue::equals(const CSSLinearGradientValue& other) const { 892 bool CSSLinearGradientValue::equals(const CSSLinearGradientValue& other) const {
893 if (m_gradientType == CSSDeprecatedLinearGradient) 893 if (m_gradientType == CSSDeprecatedLinearGradient)
894 return other.m_gradientType == m_gradientType && 894 return other.m_gradientType == m_gradientType &&
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 } 1240 }
1241 1241
1242 DCHECK(std::isfinite(firstRadius)); 1242 DCHECK(std::isfinite(firstRadius));
1243 DCHECK(std::isfinite(secondRadius.width())); 1243 DCHECK(std::isfinite(secondRadius.width()));
1244 DCHECK(std::isfinite(secondRadius.height())); 1244 DCHECK(std::isfinite(secondRadius.height()));
1245 1245
1246 bool isDegenerate = !secondRadius.width() || !secondRadius.height(); 1246 bool isDegenerate = !secondRadius.width() || !secondRadius.height();
1247 RefPtr<Gradient> gradient = 1247 RefPtr<Gradient> gradient =
1248 Gradient::create(firstPoint, firstRadius, secondPoint, 1248 Gradient::create(firstPoint, firstRadius, secondPoint,
1249 isDegenerate ? 0 : secondRadius.width(), 1249 isDegenerate ? 0 : secondRadius.width(),
1250 isDegenerate ? 1 : secondRadius.aspectRatio()); 1250 isDegenerate ? 1 : secondRadius.aspectRatio(),
1251 1251 m_repeating ? SpreadMethodRepeat : SpreadMethodPad,
1252 gradient->setSpreadMethod(m_repeating ? SpreadMethodRepeat : SpreadMethodPad); 1252 Gradient::ColorInterpolation::Premultiplied);
1253 gradient->setDrawsInPMColorSpace(true);
1254 1253
1255 // Now add the stops. 1254 // Now add the stops.
1256 addStops(gradient.get(), conversionData, object); 1255 addStops(gradient.get(), conversionData, object);
1257 1256
1258 return gradient.release(); 1257 return gradient.release();
1259 } 1258 }
1260 1259
1261 bool CSSRadialGradientValue::equals(const CSSRadialGradientValue& other) const { 1260 bool CSSRadialGradientValue::equals(const CSSRadialGradientValue& other) const {
1262 if (m_gradientType == CSSDeprecatedRadialGradient) 1261 if (m_gradientType == CSSDeprecatedRadialGradient)
1263 return other.m_gradientType == m_gradientType && 1262 return other.m_gradientType == m_gradientType &&
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 visitor->trace(m_firstRadius); 1313 visitor->trace(m_firstRadius);
1315 visitor->trace(m_secondRadius); 1314 visitor->trace(m_secondRadius);
1316 visitor->trace(m_shape); 1315 visitor->trace(m_shape);
1317 visitor->trace(m_sizingBehavior); 1316 visitor->trace(m_sizingBehavior);
1318 visitor->trace(m_endHorizontalSize); 1317 visitor->trace(m_endHorizontalSize);
1319 visitor->trace(m_endVerticalSize); 1318 visitor->trace(m_endVerticalSize);
1320 CSSGradientValue::traceAfterDispatch(visitor); 1319 CSSGradientValue::traceAfterDispatch(visitor);
1321 } 1320 }
1322 1321
1323 } // namespace blink 1322 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698