Changeset 79063 in webkit


Ignore:
Timestamp:
Feb 18, 2011 6:18:42 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-18 Noel Gordon <noel.gordon@gmail.com>

Reviewed by James Robinson.

[Chromium] Add elliptical gradient support to GradientSkia
https://bugs.webkit.org/show_bug.cgi?id=51841

Covered by existing tests, these need new rebaselines once this patch
lands for chrome linux, win32

fast/gradients/css3-color-stop-units.html
fast/gradients/css3-color-stops.html
fast/gradients/css3-linear-angle-gradients.html
fast/gradients/css3-radial-gradients.html
fast/gradients/css3-radial-gradients2.html
fast/gradients/css3-radial-gradients3.html
fast/gradients/css3-repeating-radial-gradients.html

  • platform/graphics/skia/GradientSkia.cpp: (WebCore::Gradient::platformGradient):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r79056 r79063  
     12011-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
    1222011-02-18  James Robinson  <jamesr@chromium.org>
    223
  • trunk/Source/WebCore/platform/graphics/skia/GradientSkia.cpp

    r68165 r79063  
    128128        m_stopsSorted = true;
    129129    }
     130
    130131    size_t countUsed = totalStopsNeeded(m_stops.data(), m_stops.size());
    131132    ASSERT(countUsed >= 2);
     
    168169            m_gradient = SkGradientShader::CreateTwoPointRadial(m_p0, radius0, m_p1, radius1, colors, pos, static_cast<int>(countUsed), tile);
    169170        }
     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        }
    170180    } else {
    171181        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);
    174183    }
    175184
    176185    ASSERT(m_gradient);
    177 
    178186    SkMatrix matrix = m_gradientSpaceTransformation;
    179187    m_gradient->setLocalMatrix(matrix);
    180 
    181188    return m_gradient;
    182189}
Note: See TracChangeset for help on using the changeset viewer.