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

Unified Diff: third_party/WebKit/Source/core/paint/ThemePainterMac.mm

Issue 2785203002: Split Gradient impl into separate classes (Closed)
Patch Set: review 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/ThemePainterMac.mm
diff --git a/third_party/WebKit/Source/core/paint/ThemePainterMac.mm b/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
index a8f507ad205807d9817e3cd4750aab6e09f69c3c..d3d969a61404d9fbc59a7e4805f534e6807b22cd 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
+++ b/third_party/WebKit/Source/core/paint/ThemePainterMac.mm
@@ -385,9 +385,9 @@ bool ThemePainterMac::paintSliderTrack(const LayoutObject& o,
paintInfo.context.restore();
RefPtr<Gradient> borderGradient =
- Gradient::create(fillBounds.minXMinYCorner(),
- isVerticalSlider ? fillBounds.maxXMinYCorner()
- : fillBounds.minXMaxYCorner());
+ Gradient::createLinear(fillBounds.minXMinYCorner(),
+ isVerticalSlider ? fillBounds.maxXMinYCorner()
+ : fillBounds.minXMaxYCorner());
borderGradient->addColorStop(0.0, borderGradientTopColor);
borderGradient->addColorStop(1.0, borderGradientBottomColor);
@@ -464,8 +464,8 @@ bool ThemePainterMac::paintSliderThumb(const LayoutObject& o,
paintInfo.context.setDrawLooper(nullptr);
IntRect fillBounds = enclosedIntRect(unzoomedRect);
- RefPtr<Gradient> fillGradient = Gradient::create(fillBounds.minXMinYCorner(),
- fillBounds.minXMaxYCorner());
+ RefPtr<Gradient> fillGradient = Gradient::createLinear(
+ fillBounds.minXMinYCorner(), fillBounds.minXMaxYCorner());
fillGradient->addColorStop(0.0, fillGradientTopColor);
fillGradient->addColorStop(0.52, fillGradientUpperMiddleColor);
fillGradient->addColorStop(0.52, fillGradientLowerMiddleColor);
@@ -474,7 +474,7 @@ bool ThemePainterMac::paintSliderThumb(const LayoutObject& o,
fillGradient->applyToFlags(fillFlags, SkMatrix::I());
paintInfo.context.drawOval(borderBounds, fillFlags);
- RefPtr<Gradient> borderGradient = Gradient::create(
+ RefPtr<Gradient> borderGradient = Gradient::createLinear(
fillBounds.minXMinYCorner(), fillBounds.minXMaxYCorner());
borderGradient->addColorStop(0.0, borderGradientTopColor);
borderGradient->addColorStop(1.0, borderGradientBottomColor);

Powered by Google App Engine
This is Rietveld 408576698