Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: Source/core/platform/graphics/filters/Filter.h

Issue 14701012: Refactor m_absoluteTransform out of SVGFilter and into base class. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/rendering/FilterEffectRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
Stephen Chennney 2013/05/01 18:34:18 Let's finally add ourselves to the copyright.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
(...skipping 11 matching lines...) Expand all
24 #include "core/platform/graphics/FloatSize.h" 24 #include "core/platform/graphics/FloatSize.h"
25 #include "core/platform/graphics/ImageBuffer.h" 25 #include "core/platform/graphics/ImageBuffer.h"
26 #include <wtf/RefCounted.h> 26 #include <wtf/RefCounted.h>
27 27
28 namespace WebCore { 28 namespace WebCore {
29 29
30 class FilterEffect; 30 class FilterEffect;
31 31
32 class Filter : public RefCounted<Filter> { 32 class Filter : public RefCounted<Filter> {
33 public: 33 public:
34 Filter() : m_renderingMode(Unaccelerated) { } 34 Filter(const AffineTransform& absoluteTransform) : m_absoluteTransform(absol uteTransform), m_renderingMode(Unaccelerated) { }
35 virtual ~Filter() { } 35 virtual ~Filter() { }
36 36
37 void setSourceImage(PassOwnPtr<ImageBuffer> sourceImage) { m_sourceImage = s ourceImage; } 37 void setSourceImage(PassOwnPtr<ImageBuffer> sourceImage) { m_sourceImage = s ourceImage; }
38 ImageBuffer* sourceImage() { return m_sourceImage.get(); } 38 ImageBuffer* sourceImage() { return m_sourceImage.get(); }
39 39
40 FloatSize filterResolution() const { return m_filterResolution; } 40 FloatSize filterResolution() const { return m_filterResolution; }
41 void setFilterResolution(const FloatSize& filterResolution) { m_filterResolu tion = filterResolution; } 41 void setFilterResolution(const FloatSize& filterResolution) { m_filterResolu tion = filterResolution; }
42 42
43 const AffineTransform& absoluteTransform() const { return m_absoluteTransfor m; }
44 FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { ret urn m_absoluteTransform.inverse().mapPoint(point); }
45
43 RenderingMode renderingMode() const { return m_renderingMode; } 46 RenderingMode renderingMode() const { return m_renderingMode; }
44 void setRenderingMode(RenderingMode renderingMode) { m_renderingMode = rende ringMode; } 47 void setRenderingMode(RenderingMode renderingMode) { m_renderingMode = rende ringMode; }
45 48
46 virtual float applyHorizontalScale(float value) const { return value * m_fil terResolution.width(); } 49 virtual float applyHorizontalScale(float value) const { return value * m_fil terResolution.width(); }
47 virtual float applyVerticalScale(float value) const { return value * m_filte rResolution.height(); } 50 virtual float applyVerticalScale(float value) const { return value * m_filte rResolution.height(); }
48 51
49 virtual FloatRect sourceImageRect() const = 0; 52 virtual FloatRect sourceImageRect() const = 0;
50 virtual FloatRect filterRegion() const = 0; 53 virtual FloatRect filterRegion() const = 0;
51 54
52 virtual FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint&) const { r eturn FloatPoint(); }
53 55
54 private: 56 private:
55 OwnPtr<ImageBuffer> m_sourceImage; 57 OwnPtr<ImageBuffer> m_sourceImage;
56 FloatSize m_filterResolution; 58 FloatSize m_filterResolution;
57 RenderingMode m_renderingMode; 59 RenderingMode m_renderingMode;
60 AffineTransform m_absoluteTransform;
58 }; 61 };
59 62
60 } // namespace WebCore 63 } // namespace WebCore
61 64
62 #endif // Filter_h 65 #endif // Filter_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/FilterEffectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698