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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.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/layout/svg/ReferenceFilterBuilder.cpp ('k') | Source/core/paint/FilterEffectBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index 35816c7fce8fc8f7916048454bae7897b8e2df9d..1e334f16e14d41fb5713fab74698db4f1f308f1a 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -2620,7 +2620,7 @@ FilterOperations DeprecatedPaintLayer::computeFilterOperations(const ComputedSty
ReferenceFilterOperation& referenceOperation = toReferenceFilterOperation(*filterOperation);
// FIXME: Cache the ReferenceFilter if it didn't change.
RefPtrWillBeRawPtr<ReferenceFilter> referenceFilter = ReferenceFilter::create(style.effectiveZoom());
- referenceFilter->setLastEffect(ReferenceFilterBuilder::build(referenceFilter.get(), *layoutObject(), referenceFilter->sourceGraphic(),
+ referenceFilter->setLastEffect(ReferenceFilterBuilder::build(referenceFilter.get(), toElement(enclosingElement()), referenceFilter->sourceGraphic(),
referenceOperation));
referenceOperation.setFilter(referenceFilter.release());
}
@@ -2662,7 +2662,8 @@ void DeprecatedPaintLayer::updateOrRemoveFilterEffectBuilder()
// If the filter fails to build, remove it from the layer. It will still attempt to
// go through regular processing (e.g. compositing), but never apply anything.
- if (!filterInfo->builder()->build(layoutObject(), computeFilterOperations(layoutObject()->styleRef())))
+ float zoom = layoutObject()->style() ? layoutObject()->style()->effectiveZoom() : 1.0f;
+ if (!filterInfo->builder()->build(toElement(enclosingElement()), computeFilterOperations(layoutObject()->styleRef()), zoom))
filterInfo->setBuilder(nullptr);
}
« no previous file with comments | « Source/core/layout/svg/ReferenceFilterBuilder.cpp ('k') | Source/core/paint/FilterEffectBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698