2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
27 #include "core/dom/TreeScope.h"
28 #include "core/svg/SVGPreserveAspectRatio.h"
29 #include "platform/graphics/filters/FilterEffect.h"
36 class FEImage final : public FilterEffect {
38 static PassRefPtr<FEImage> createWithImage(Filter*, PassRefPtr<Image>, PassRefPtr<SVGPreserveAspectRatio>);
39 static PassRefPtr<FEImage> createWithIRIReference(Filter*, TreeScope&, const String&, PassRefPtr<SVGPreserveAspectRatio>);
41 virtual FloatRect determineAbsolutePaintRect(const FloatRect& requestedRect) override;
43 virtual FilterEffectType filterEffectType() const override { return FilterEffectTypeImage; }
45 virtual TextStream& externalRepresentation(TextStream&, int indention) const override;
46 virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) override;
49 virtual ~FEImage() { }
50 FEImage(Filter*, PassRefPtr<Image>, PassRefPtr<SVGPreserveAspectRatio>);
51 FEImage(Filter*, TreeScope&, const String&, PassRefPtr<SVGPreserveAspectRatio>);
52 RenderObject* referencedRenderer() const;
54 PassRefPtr<SkImageFilter> createImageFilterForRenderer(RenderObject* rendererer, SkiaImageFilterBuilder*);
56 RefPtr<Image> m_image;
58 // m_treeScope will never be a dangling reference. See https://bugs.webkit.org/show_bug.cgi?id=99243
59 TreeScope* m_treeScope;
61 PassRefPtr<SVGPreserveAspectRatio> m_preserveAspectRatio;
66 #endif // SVGFEImage_h