Changeset 79063 in webkit
- Timestamp:
- Feb 18, 2011 6:18:42 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79056 r79063 1 2011-02-18 Noel Gordon <noel.gordon@gmail.com> 2 3 Reviewed by James Robinson. 4 5 [Chromium] Add elliptical gradient support to GradientSkia 6 https://bugs.webkit.org/show_bug.cgi?id=51841 7 8 Covered by existing tests, these need new rebaselines once this patch 9 lands for chrome linux, win32 10 11 fast/gradients/css3-color-stop-units.html 12 fast/gradients/css3-color-stops.html 13 fast/gradients/css3-linear-angle-gradients.html 14 fast/gradients/css3-radial-gradients.html 15 fast/gradients/css3-radial-gradients2.html 16 fast/gradients/css3-radial-gradients3.html 17 fast/gradients/css3-repeating-radial-gradients.html 18 19 * platform/graphics/skia/GradientSkia.cpp: 20 (WebCore::Gradient::platformGradient): 21 1 22 2011-02-18 James Robinson <jamesr@chromium.org> 2 23 -
trunk/Source/WebCore/platform/graphics/skia/GradientSkia.cpp
r68165 r79063 128 128 m_stopsSorted = true; 129 129 } 130 130 131 size_t countUsed = totalStopsNeeded(m_stops.data(), m_stops.size()); 131 132 ASSERT(countUsed >= 2); … … 168 169 m_gradient = SkGradientShader::CreateTwoPointRadial(m_p0, radius0, m_p1, radius1, colors, pos, static_cast<int>(countUsed), tile); 169 170 } 171 172 if (aspectRatio() != 1) { 173 // CSS3 elliptical gradients: apply the elliptical scaling at the 174 // gradient center point. 175 m_gradientSpaceTransformation.translate(m_p0.x(), m_p0.y()); 176 m_gradientSpaceTransformation.scale(1, 1 / aspectRatio()); 177 m_gradientSpaceTransformation.translate(-m_p0.x(), -m_p0.y()); 178 ASSERT(m_p0 == m_p1); 179 } 170 180 } else { 171 181 SkPoint pts[2] = { m_p0, m_p1 }; 172 m_gradient = SkGradientShader::CreateLinear(pts, colors, pos, 173 static_cast<int>(countUsed), tile); 182 m_gradient = SkGradientShader::CreateLinear(pts, colors, pos, static_cast<int>(countUsed), tile); 174 183 } 175 184 176 185 ASSERT(m_gradient); 177 178 186 SkMatrix matrix = m_gradientSpaceTransformation; 179 187 m_gradient->setLocalMatrix(matrix); 180 181 188 return m_gradient; 182 189 }
Note: See TracChangeset
for help on using the changeset viewer.