diff options
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 |
