Changeset 207028 in webkit
- Timestamp:
- Oct 10, 2016 3:10:55 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207027 r207028 1 2016-10-10 Brent Fulgham <bfulgham@apple.com> 2 3 [Win][Direct2D] Correct Radial Graident Bug 4 https://bugs.webkit.org/show_bug.cgi?id=163241 5 6 Reviewed by Darin Adler. 7 8 Radial gradients were not working correctly under Direct2D because the 9 points and radius values used were incorrect. D2D wants a center point and 10 an offset, not a start and end point. It wants an X and Y radius (for an 11 ellipse), not a radius at the start point, and a radius at the end point. 12 13 Covered by existing fast/gradients/css-radial-gradients.html (and others). 14 15 * platform/graphics/Image.cpp: 16 (WebCore::Image::drawTiled): Remove 'notImplemented' code path. 17 * platform/graphics/win/GradientDirect2D.cpp: 18 (WebCore::Gradient::generateGradient): Use correct input values to 19 the Radial Gradient constructor. 20 (WebCore::Gradient::fill): Generate a gradient if we have no active 21 one to use. 22 1 23 2016-10-10 Jiewen Tan <jiewen_tan@apple.com> 2 24 -
trunk/Source/WebCore/platform/graphics/Image.cpp
r206872 r207028 94 94 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, const FloatSize& spacing, CompositeOperator op, BlendMode blendMode) 95 95 { 96 #if USE(DIRECT2D)97 notImplemented();98 #else99 96 Color color = singlePixelSolidColor(); 100 97 if (color.isValid()) { … … 204 201 startAnimation(); 205 202 #endif 206 #endif207 203 } 208 204 -
trunk/Source/WebCore/platform/graphics/win/GradientDirect2D.cpp
r206830 r207028 68 68 69 69 if (m_radial) { 70 FloatSize offset = p1() - p0(); 70 71 ID2D1RadialGradientBrush* radialGradient = nullptr; 72 float radiusX = endRadius() + offset.width(); 73 float radiusY = radiusX / m_aspectRatio; 71 74 hr = renderTarget->CreateRadialGradientBrush( 72 D2D1::RadialGradientBrushProperties(p0(), p1(), startRadius(), endRadius()),75 D2D1::RadialGradientBrushProperties(p0(), D2D1::Point2F(offset.width(), offset.height()), radiusX, radiusY), 73 76 D2D1::BrushProperties(), gradientStopCollection.get(), 74 77 &radialGradient); … … 110 113 } 111 114 112 if (!m_cachedHash )115 if (!m_cachedHash || !m_gradient) 113 116 generateGradient(d2dContext); 114 117
Note: See TracChangeset
for help on using the changeset viewer.