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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceLinearGradient.cpp

Issue 2749583002: Add Gradient::addColorStops method (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(), 49 return SVGLengthContext::resolvePoint(element(), attributes.gradientUnits(),
50 *attributes.x2(), *attributes.y2()); 50 *attributes.x2(), *attributes.y2());
51 } 51 }
52 52
53 PassRefPtr<Gradient> LayoutSVGResourceLinearGradient::buildGradient() const { 53 PassRefPtr<Gradient> LayoutSVGResourceLinearGradient::buildGradient() const {
54 const LinearGradientAttributes& attributes = this->attributes(); 54 const LinearGradientAttributes& attributes = this->attributes();
55 RefPtr<Gradient> gradient = 55 RefPtr<Gradient> gradient =
56 Gradient::create(startPoint(attributes), endPoint(attributes)); 56 Gradient::create(startPoint(attributes), endPoint(attributes));
57 gradient->setSpreadMethod( 57 gradient->setSpreadMethod(
58 platformSpreadMethodFromSVGType(attributes.spreadMethod())); 58 platformSpreadMethodFromSVGType(attributes.spreadMethod()));
59 addStops(*gradient, attributes.stops()); 59 gradient->addColorStops(attributes.stops());
60 return gradient.release(); 60 return gradient.release();
61 } 61 }
62 62
63 } // namespace blink 63 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698