Changeset 62753 in webkit


Ignore:
Timestamp:
Jul 7, 2010 9:07:34 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-07 Nicolas Weber <thakis@chromium.org>

Reviewed by Dimitri Glazkov.
https://bugs.webkit.org/show_bug.cgi?id=41580

Fix rendering of radial gradients in skia if both points of the
gradient are the same and r0 > 0.

  • fast/gradients/radial-centered.html: Added.

2010-07-07 Nicolas Weber <thakis@chromium.org>

Reviewed by Dimitri Glazkov.
https://bugs.webkit.org/show_bug.cgi?id=41580

Fix rendering of radial gradients in skia if both points of the
gradient are the same and r0 > 0.

Test: fast/gradients/radial-centered.html

  • platform/graphics/skia/GradientSkia.cpp: (WebCore::Gradient::platformGradient):
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62741 r62753  
     12010-07-07  Nicolas Weber  <thakis@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4        https://bugs.webkit.org/show_bug.cgi?id=41580
     5
     6        Fix rendering of radial gradients in skia if both points of the
     7        gradient are the same and r0 > 0.
     8
     9        * fast/gradients/radial-centered.html: Added.
     10
    1112010-06-18  MORITA Hajime  <morrita@google.com>
    212
  • trunk/WebCore/ChangeLog

    r62741 r62753  
     12010-07-07  Nicolas Weber  <thakis@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4        https://bugs.webkit.org/show_bug.cgi?id=41580
     5
     6        Fix rendering of radial gradients in skia if both points of the
     7        gradient are the same and r0 > 0.
     8
     9        Test: fast/gradients/radial-centered.html
     10
     11        * platform/graphics/skia/GradientSkia.cpp:
     12        (WebCore::Gradient::platformGradient):
     13
    1142010-06-18  MORITA Hajime  <morrita@google.com>
    215
  • trunk/WebCore/platform/graphics/skia/GradientSkia.cpp

    r54503 r62753  
    155155        // Since the two-point radial gradient is slower than the plain radial,
    156156        // only use it if we have to.
    157         if (m_p0 != m_p1) {
     157        if (m_p0 == m_p1 && m_r0 <= 0.0f) {
     158            // The radius we give to Skia must be positive (and non-zero).  If
     159            // we're given a zero radius, just ask for a very small radius so
     160            // Skia will still return an object.
     161            SkScalar radius = m_r1 > 0 ? WebCoreFloatToSkScalar(m_r1) : SK_ScalarMin;
     162            m_gradient = SkGradientShader::CreateRadial(m_p1, radius, colors, pos, static_cast<int>(countUsed), tile);
     163        } else {
    158164            // The radii we give to Skia must be positive.  If we're given a
    159165            // negative radius, ask for zero instead.
     
    161167            SkScalar radius1 = m_r1 >= 0.0f ? WebCoreFloatToSkScalar(m_r1) : 0;
    162168            m_gradient = SkGradientShader::CreateTwoPointRadial(m_p0, radius0, m_p1, radius1, colors, pos, static_cast<int>(countUsed), tile);
    163         } else {
    164             // The radius we give to Skia must be positive (and non-zero).  If
    165             // we're given a zero radius, just ask for a very small radius so
    166             // Skia will still return an object.
    167             SkScalar radius = m_r1 > 0 ? WebCoreFloatToSkScalar(m_r1) : SK_ScalarMin;
    168             m_gradient = SkGradientShader::CreateRadial(m_p1, radius, colors, pos, static_cast<int>(countUsed), tile);
    169169        }
    170170    } else {
Note: See TracChangeset for help on using the changeset viewer.