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

Side by Side Diff: Source/core/svg/GradientAttributes.h

Issue 423093014: [SVG2] Make transform, gradientTransform and patternTransform presentation attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline for mac/win Created 6 years, 4 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 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 m_spreadMethod = value; 45 m_spreadMethod = value;
46 m_spreadMethodSet = true; 46 m_spreadMethodSet = true;
47 } 47 }
48 48
49 void setGradientUnits(SVGUnitTypes::SVGUnitType unitType) 49 void setGradientUnits(SVGUnitTypes::SVGUnitType unitType)
50 { 50 {
51 m_gradientUnits = unitType; 51 m_gradientUnits = unitType;
52 m_gradientUnitsSet = true; 52 m_gradientUnitsSet = true;
53 } 53 }
54 54
55 void setGradientTransformFromStyle(SVGGradientElement* element)
56 {
57 AffineTransform transform;
58 bool hasTransform = element->getStyleTransform(transform);
59
60 // If CSS property was set, use that, otherwise fallback to attribute (i f set).
61 if (!hasTransform && element->gradientTransform()->isSpecified()) {
62 element->gradientTransform()->currentValue()->concatenate(transform) ;
63 hasTransform = true;
64 }
65
66 if (hasTransform)
67 setGradientTransform(transform);
68 }
69
55 void setGradientTransform(const AffineTransform& value) 70 void setGradientTransform(const AffineTransform& value)
56 { 71 {
57 m_gradientTransform = value; 72 m_gradientTransform = value;
58 m_gradientTransformSet = true; 73 m_gradientTransformSet = true;
59 } 74 }
60 75
61 void setStops(const Vector<Gradient::ColorStop>& value) 76 void setStops(const Vector<Gradient::ColorStop>& value)
62 { 77 {
63 m_stops = value; 78 m_stops = value;
64 m_stopsSet = true; 79 m_stopsSet = true;
(...skipping 23 matching lines...) Expand all
88 AffineTransform a; 103 AffineTransform a;
89 Vector<Gradient::ColorStop> b; 104 Vector<Gradient::ColorStop> b;
90 unsigned c : 8; 105 unsigned c : 8;
91 }; 106 };
92 107
93 COMPILE_ASSERT(sizeof(GradientAttributes) == sizeof(SameSizeAsGradientAttributes ), GradientAttributes_size_guard); 108 COMPILE_ASSERT(sizeof(GradientAttributes) == sizeof(SameSizeAsGradientAttributes ), GradientAttributes_size_guard);
94 109
95 } // namespace blink 110 } // namespace blink
96 111
97 #endif 112 #endif
OLDNEW
« no previous file with comments | « LayoutTests/svg/transforms/translate-without-units-expected.svg ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698