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

Unified Diff: Source/core/paint/FilterEffectBuilder.cpp

Issue 1194733002: Adding the 'filter' context attribute to 2D canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: applied corrections Created 5 years, 6 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/core/paint/FilterEffectBuilder.h ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/FilterEffectBuilder.cpp
diff --git a/Source/core/paint/FilterEffectBuilder.cpp b/Source/core/paint/FilterEffectBuilder.cpp
index 357315fefad6c4f8aa0cadc7eb39064be4751085..5469a81de6804fcff3483ac8768b863b7ac35238 100644
--- a/Source/core/paint/FilterEffectBuilder.cpp
+++ b/Source/core/paint/FilterEffectBuilder.cpp
@@ -71,11 +71,8 @@ DEFINE_TRACE(FilterEffectBuilder)
visitor->trace(m_referenceFilters);
}
-bool FilterEffectBuilder::build(LayoutObject* layoutObject, const FilterOperations& operations)
+bool FilterEffectBuilder::build(Element* element, const FilterOperations& operations, float zoom)
{
- const ComputedStyle* style = layoutObject->style();
- float zoom = style ? style->effectiveZoom() : 1.0f;
-
// Create a parent filter for shorthand filters. These have already been scaled by the CSS code for page zoom, so scale is 1.0 here.
RefPtrWillBeRawPtr<ReferenceFilter> parentFilter = ReferenceFilter::create(1.0f);
RefPtrWillBeRawPtr<FilterEffect> previousEffect = SourceGraphic::create(parentFilter.get());
@@ -85,7 +82,7 @@ bool FilterEffectBuilder::build(LayoutObject* layoutObject, const FilterOperatio
switch (filterOperation->type()) {
case FilterOperation::REFERENCE: {
RefPtrWillBeRawPtr<ReferenceFilter> referenceFilter = ReferenceFilter::create(zoom);
- effect = ReferenceFilterBuilder::build(referenceFilter.get(), *layoutObject, previousEffect.get(), toReferenceFilterOperation(*filterOperation));
+ effect = ReferenceFilterBuilder::build(referenceFilter.get(), element, previousEffect.get(), toReferenceFilterOperation(*filterOperation));
referenceFilter->setLastEffect(effect);
m_referenceFilters.append(referenceFilter);
break;
« no previous file with comments | « Source/core/paint/FilterEffectBuilder.h ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698