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

Unified Diff: Source/platform/graphics/filters/Filter.cpp

Issue 1326183002: Merge ReferenceFilter into Filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Touchups; Rebase. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/filters/Filter.h ('k') | Source/platform/graphics/filters/FilterOperation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/platform/graphics/filters/Filter.h ('k') | Source/platform/graphics/filters/FilterOperation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698