Skip to content
Permalink
Browse files
2011-04-20 Dirk Schulze <krit@webkit.org>
        Reviewed by Simon Fraser.

        SVG feDropShadow implementation of SVG Filters 1.2
        https://bugs.webkit.org/show_bug.cgi?id=52513

        Support different radii for horizontal and vertical blurring in ShadowBlur. This is a preperation for feDropShadow.
        feDropShadow is a new shorthand filter effect for the up-comming Filter 1.0 specification and will use ShadowBlur.
        feGaussianBlur might make use of ShadowBlur as well later (on SourceAlpha input).
        Added ShadowBlur to remaining platforms.

        The changes can't be tested before the changes in feGaussianBlur or feDropShadow. Current behavior is not affected.

        * Android.mk:
        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * WebCore.pro:
        * platform/graphics/FloatSize.h:
        (WebCore::FloatSize::scale):
        * platform/graphics/ShadowBlur.cpp:
        (WebCore::ScratchBuffer::ScratchBuffer):
        (WebCore::ScratchBuffer::setLastShadowValues):
        (WebCore::ScratchBuffer::setLastInsetShadowValues):
        (WebCore::ScratchBuffer::matchesLastShadow):
        (WebCore::ScratchBuffer::matchesLastInsetShadow):
        (WebCore::ScratchBuffer::clearScratchBuffer):
        (WebCore::ShadowBlur::ShadowBlur):
        (WebCore::calculateLobes):
        (WebCore::ShadowBlur::blurLayerImage):
        (WebCore::ShadowBlur::adjustBlurRadius):
        (WebCore::ShadowBlur::calculateLayerBoundingRect):
        (WebCore::computeSliceSizesFromRadii):
        (WebCore::ShadowBlur::templateSize):
        (WebCore::ShadowBlur::drawInsetShadowWithTiling):
        (WebCore::ShadowBlur::drawRectShadowWithTiling):
        (WebCore::ShadowBlur::drawLayerPieces):
        * platform/graphics/ShadowBlur.h:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::fillRoundedRect):
        (WebCore::GraphicsContext::fillRectWithRoundedHole):


Canonical link: https://commits.webkit.org/74149@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dirkschulze committed Apr 20, 2011
1 parent 25f33df commit 0d8152586542dc150b31492f3be1ca50d02019fa
Showing 9 changed files with 126 additions and 62 deletions.
@@ -555,6 +555,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/graphics/Pattern.cpp \
platform/graphics/RoundedIntRect.cpp \
platform/graphics/SegmentedFontData.cpp \
platform/graphics/ShadowBlur.cpp \
platform/graphics/SimpleFontData.cpp \
platform/graphics/StringTruncator.cpp \
platform/graphics/WidthIterator.cpp
@@ -1108,6 +1108,7 @@ SET(WebCore_SOURCES
platform/graphics/Pattern.cpp
platform/graphics/RoundedIntRect.cpp
platform/graphics/SegmentedFontData.cpp
platform/graphics/ShadowBlur.cpp
platform/graphics/SimpleFontData.cpp
platform/graphics/StringTruncator.cpp
platform/graphics/WidthIterator.cpp
@@ -1,3 +1,46 @@
2011-04-20 Dirk Schulze <krit@webkit.org>

Reviewed by Simon Fraser.

SVG feDropShadow implementation of SVG Filters 1.2
https://bugs.webkit.org/show_bug.cgi?id=52513

Support different radii for horizontal and vertical blurring in ShadowBlur. This is a preperation for feDropShadow.
feDropShadow is a new shorthand filter effect for the up-comming Filter 1.0 specification and will use ShadowBlur.
feGaussianBlur might make use of ShadowBlur as well later (on SourceAlpha input).
Added ShadowBlur to remaining platforms.

The changes can't be tested before the changes in feGaussianBlur or feDropShadow. Current behavior is not affected.

* Android.mk:
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.pro:
* platform/graphics/FloatSize.h:
(WebCore::FloatSize::scale):
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::ScratchBuffer):
(WebCore::ScratchBuffer::setLastShadowValues):
(WebCore::ScratchBuffer::setLastInsetShadowValues):
(WebCore::ScratchBuffer::matchesLastShadow):
(WebCore::ScratchBuffer::matchesLastInsetShadow):
(WebCore::ScratchBuffer::clearScratchBuffer):
(WebCore::ShadowBlur::ShadowBlur):
(WebCore::calculateLobes):
(WebCore::ShadowBlur::blurLayerImage):
(WebCore::ShadowBlur::adjustBlurRadius):
(WebCore::ShadowBlur::calculateLayerBoundingRect):
(WebCore::computeSliceSizesFromRadii):
(WebCore::ShadowBlur::templateSize):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawLayerPieces):
* platform/graphics/ShadowBlur.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):

2011-04-19 Roland Steiner <rolandsteiner@chromium.org>

Reviewed by Dimitri Glazkov.
@@ -2463,6 +2463,8 @@ webcore_sources += \
Source/WebCore/platform/graphics/RoundedIntRect.h \
Source/WebCore/platform/graphics/SegmentedFontData.cpp \
Source/WebCore/platform/graphics/SegmentedFontData.h \
Source/WebCore/platform/graphics/ShadowBlur.cpp \
Source/WebCore/platform/graphics/ShadowBlur.h \
Source/WebCore/platform/graphics/SimpleFontData.cpp \
Source/WebCore/platform/graphics/SimpleFontData.h \
Source/WebCore/platform/graphics/StringTruncator.cpp \
@@ -995,6 +995,7 @@ SOURCES += \
platform/graphics/Pattern.cpp \
platform/graphics/RoundedIntRect.cpp \
platform/graphics/SegmentedFontData.cpp \
platform/graphics/ShadowBlur.cpp \
platform/graphics/SimpleFontData.cpp \
platform/graphics/TiledBackingStore.cpp \
platform/graphics/transforms/AffineTransform.cpp \
@@ -1971,6 +1972,7 @@ HEADERS += \
platform/graphics/qt/StillImageQt.h \
platform/graphics/qt/TransparencyLayer.h \
platform/graphics/SegmentedFontData.h \
platform/graphics/ShadowBlur.h \
platform/graphics/SimpleFontData.h \
platform/graphics/Tile.h \
platform/graphics/TiledBackingStore.h \
@@ -65,10 +65,12 @@ class FloatSize {

float aspectRatio() const { return m_width / m_height; }

void scale(float scale)
void scale(float s) { scale(s, s); }

void scale(float scaleX, float scaleY)
{
m_width *= scale;
m_height *= scale;
m_width *= scaleX;
m_height *= scaleY;
}

FloatSize expandedTo(const FloatSize& other) const

0 comments on commit 0d81525

Please sign in to comment.