diff options
author | Leon Clarke <leonclarke@google.com> | 2010-06-03 14:33:32 +0100 |
---|---|---|
committer | Leon Clarke <leonclarke@google.com> | 2010-06-08 12:24:51 +0100 |
commit | 5af96e2c7b73ebc627c6894727826a7576d31758 (patch) | |
tree | f9d5e6f6175ccd7e3d14de9b290f08937a0d17ba /WebCore/svg | |
parent | 8cc4fcf4f6adcbc0e0aebfc24fbad9a4cddf2cfb (diff) | |
download | external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.zip external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.gz external_webkit-5af96e2c7b73ebc627c6894727826a7576d31758.tar.bz2 |
Merge webkit.org at r60469 : Initial merge by git.
Change-Id: I66a0047aa2af802f66bb0c7f2a8b02247a596234
Diffstat (limited to 'WebCore/svg')
-rw-r--r-- | WebCore/svg/SVGSVGElement.cpp | 10 | ||||
-rw-r--r-- | WebCore/svg/graphics/filters/SVGLightSource.cpp | 15 |
2 files changed, 13 insertions, 12 deletions
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp index af3e5b6..4b14a1f 100644 --- a/WebCore/svg/SVGSVGElement.cpp +++ b/WebCore/svg/SVGSVGElement.cpp @@ -33,7 +33,7 @@ #include "EventNames.h" #include "FloatConversion.h" #include "FloatRect.h" -#include "Frame.h" +#include "FrameView.h" #include "HTMLNames.h" #include "RenderSVGRoot.h" #include "RenderSVGViewportContainer.h" @@ -188,18 +188,18 @@ SVGViewSpec* SVGSVGElement::currentView() const float SVGSVGElement::currentScale() const { // Only the page zoom factor is relevant for SVG - if (Frame* frame = document()->frame()) - return frame->pageZoomFactor(); + if (FrameView* view = document()->view()) + return view->pageZoomFactor(); return m_scale; } void SVGSVGElement::setCurrentScale(float scale) { - if (Frame* frame = document()->frame()) { + if (FrameView* view = document()->view()) { // Calling setCurrentScale() on the outermost <svg> element in a standalone SVG document // is allowed to change the page zoom factor, influencing the document size, scrollbars etc. if (parentNode() == document()) - frame->setZoomFactor(scale, ZoomPage); + view->setZoomFactor(scale, ZoomPage); return; } diff --git a/WebCore/svg/graphics/filters/SVGLightSource.cpp b/WebCore/svg/graphics/filters/SVGLightSource.cpp index 2a04af6..d243eba 100644 --- a/WebCore/svg/graphics/filters/SVGLightSource.cpp +++ b/WebCore/svg/graphics/filters/SVGLightSource.cpp @@ -45,6 +45,10 @@ void PointLightSource::updatePaintingData(PaintingData& paintingData, int x, int paintingData.lightVector.normalize(); } +// spot-light edge darkening depends on an absolute treshold +// according to the SVG 1.1 SE light regression tests +static const float antiAliasTreshold = 0.016f; + void SpotLightSource::initPaintingData(PaintingData& paintingData) { paintingData.privateColorVector = paintingData.colorVector; @@ -55,18 +59,15 @@ void SpotLightSource::initPaintingData(PaintingData& paintingData) if (!m_limitingConeAngle) { paintingData.coneCutOffLimit = 0.0f; - paintingData.coneFullLight = cosf(deg2rad(92.0f)); + paintingData.coneFullLight = -antiAliasTreshold; } else { float limitingConeAngle = m_limitingConeAngle; if (limitingConeAngle < 0.0f) - limitingConeAngle = 0.0f; - else if (limitingConeAngle > 90.0f) + limitingConeAngle = -limitingConeAngle; + if (limitingConeAngle > 90.0f) limitingConeAngle = 90.0f; paintingData.coneCutOffLimit = cosf(deg2rad(180.0f - limitingConeAngle)); - limitingConeAngle -= 2.0f; - if (limitingConeAngle < 0.0f) - limitingConeAngle = 0.0f; - paintingData.coneFullLight = cosf(deg2rad(180.0f - limitingConeAngle)); + paintingData.coneFullLight = paintingData.coneCutOffLimit - antiAliasTreshold; } // Optimization for common specularExponent values |