Index: Source/platform/graphics/filters/Filter.cpp |
diff --git a/Source/platform/graphics/filters/ReferenceFilter.cpp b/Source/platform/graphics/filters/Filter.cpp |
similarity index 73% |
rename from Source/platform/graphics/filters/ReferenceFilter.cpp |
rename to Source/platform/graphics/filters/Filter.cpp |
index d483c2d25a6b60270560d2e83949411231156bfc..6aa814174cf3c2b485dbfd493fbab4b508f8ace4 100644 |
--- a/Source/platform/graphics/filters/ReferenceFilter.cpp |
+++ b/Source/platform/graphics/filters/Filter.cpp |
@@ -29,32 +29,46 @@ |
*/ |
#include "config.h" |
- |
-#include "platform/graphics/filters/ReferenceFilter.h" |
+#include "platform/graphics/filters/Filter.h" |
#include "platform/graphics/filters/FilterEffect.h" |
#include "platform/graphics/filters/SourceGraphic.h" |
namespace blink { |
-ReferenceFilter::ReferenceFilter(const FloatRect& targetBoundingBox, const FloatRect& filterRegion, float scale) |
- : Filter(targetBoundingBox, filterRegion, scale) |
+Filter::Filter(const FloatRect& referenceBox, const FloatRect& filterRegion, float scale) |
+ : m_referenceBox(referenceBox) |
+ , m_filterRegion(filterRegion) |
+ , m_scale(scale) |
, m_sourceGraphic(SourceGraphic::create(this)) |
{ |
} |
-ReferenceFilter::~ReferenceFilter() |
+Filter::~Filter() |
{ |
} |
-DEFINE_TRACE(ReferenceFilter) |
+DEFINE_TRACE(Filter) |
{ |
visitor->trace(m_sourceGraphic); |
visitor->trace(m_lastEffect); |
- Filter::trace(visitor); |
} |
-void ReferenceFilter::setLastEffect(PassRefPtrWillBeRawPtr<FilterEffect> effect) |
+FloatRect Filter::mapLocalRectToAbsoluteRect(const FloatRect& rect) const |
+{ |
+ FloatRect result(rect); |
+ result.scale(m_scale); |
+ return result; |
+} |
+ |
+FloatRect Filter::mapAbsoluteRectToLocalRect(const FloatRect& rect) const |
+{ |
+ FloatRect result(rect); |
+ result.scale(1.0f / m_scale); |
+ return result; |
+} |
+ |
+void Filter::setLastEffect(PassRefPtrWillBeRawPtr<FilterEffect> effect) |
{ |
m_lastEffect = effect; |
} |