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.
23 #include "AffineTransform.h"
25 #include "FilterEffect.h"
26 #include "FloatRect.h"
28 #include <wtf/TypeCasts.h>
32 class SVGFilter final : public Filter {
34 static Ref<SVGFilter> create(const AffineTransform&, const FloatRect&, const FloatRect&, const FloatRect&, bool);
36 FloatRect filterRegionInUserSpace() const final { return m_filterRegion; }
37 FloatRect filterRegion() const final { return m_absoluteFilterRegion; }
39 FloatSize scaledByFilterResolution(FloatSize) const final;
41 FloatRect sourceImageRect() const final { return m_absoluteSourceDrawingRegion; }
42 FloatRect targetBoundingBox() const { return m_targetBoundingBox; }
44 bool isSVGFilter() const final { return true; }
47 SVGFilter(const AffineTransform& absoluteTransform, const FloatRect& absoluteSourceDrawingRegion, const FloatRect& targetBoundingBox, const FloatRect& filterRegion, bool effectBBoxMode);
49 FloatRect m_absoluteSourceDrawingRegion;
50 FloatRect m_targetBoundingBox;
51 FloatRect m_absoluteFilterRegion;
52 FloatRect m_filterRegion;
53 bool m_effectBBoxMode;
56 } // namespace WebCore
58 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGFilter)
59 static bool isType(const WebCore::Filter& filter) { return filter.isSVGFilter(); }
60 SPECIALIZE_TYPE_TRAITS_END()