2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
3 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
24 #include "AffineTransform.h"
26 #include "FilterEffect.h"
27 #include "FloatRect.h"
28 #include "FloatSize.h"
30 #include <wtf/PassRefPtr.h>
31 #include <wtf/RefCounted.h>
32 #include <wtf/RefPtr.h>
33 #include <wtf/TypeCasts.h>
37 class SVGFilter : public Filter {
39 static PassRefPtr<SVGFilter> create(const AffineTransform&, const FloatRect&, const FloatRect&, const FloatRect&, bool);
41 FloatRect filterRegionInUserSpace() const { return m_filterRegion; }
42 virtual FloatRect filterRegion() const override { return m_absoluteFilterRegion; }
44 virtual float applyHorizontalScale(float value) const override;
45 virtual float applyVerticalScale(float value) const override;
47 virtual FloatRect sourceImageRect() const override { return m_absoluteSourceDrawingRegion; }
48 FloatRect targetBoundingBox() const { return m_targetBoundingBox; }
50 virtual bool isSVGFilter() const override final { return true; }
53 SVGFilter(const AffineTransform& absoluteTransform, const FloatRect& absoluteSourceDrawingRegion, const FloatRect& targetBoundingBox, const FloatRect& filterRegion, bool effectBBoxMode);
55 FloatRect m_absoluteSourceDrawingRegion;
56 FloatRect m_targetBoundingBox;
57 FloatRect m_absoluteFilterRegion;
58 FloatRect m_filterRegion;
59 bool m_effectBBoxMode;
62 } // namespace WebCore
64 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGFilter)
65 static bool isType(const WebCore::Filter& filter) { return filter.isSVGFilter(); }
66 SPECIALIZE_TYPE_TRAITS_END()