WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
19388
Filter Effects being cleared and reloaded multiple times
https://bugs.webkit.org/show_bug.cgi?id=19388
Summary
Filter Effects being cleared and reloaded multiple times
Alex Mathews
Reported
2008-06-03 21:28:24 PDT
On close inspection the filter effects for each filter were being cleared and added to the Vector<SVGFilterEffect*> in SVGResourceFilter every time a styled svg element is found, I believe. To find this I added a printf telling me what the values of the effect's "in" attribute are as they go through SVGResourceFilter::addFilterEffect() and looked at the output from an example svg filter image:
http://www.w3.org/TR/SVG11/images/filters/filters01.svg
Though it is probably easier to just set a breakpoint in the addFilterEffect function and debug it. The output I got when running through that example svg with my printf was: SourceAlpha blur blur specOut SourceGraphic (null impl) <-- that is just because the feMerge doesn't have an "in" attribute 7 times total.
Attachments
Possible patch for eseidel/MacDome??
(2.51 KB, patch)
2008-06-03 21:34 PDT
,
Alex Mathews
no flags
Details
Formatted Diff
Diff
Calculate the filters once, not on every call af applyFilter
(10.51 KB, patch)
2010-01-01 01:25 PST
,
Dirk Schulze
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Alex Mathews
Comment 1
2008-06-03 21:34:49 PDT
Created
attachment 21494
[details]
Possible patch for eseidel/MacDome?? If I am indeed correct and this is not the correct behavior, checking for whether or not the vector is populated before clearing it and repopulating it provides a fix.
Eric Seidel (no email)
Comment 2
2008-06-05 07:02:48 PDT
I'll look at this again later today. I'll need to stare at the exiting code a bit.
Alex Mathews
Comment 3
2008-06-06 14:00:29 PDT
Had a talk with Eric about this and while it is not really correct behavior, for the moment it will stand. My patch would break many things because it doesn't take into account the fact that filter effects can be added and removed as well as individual attributes changed. So while the current behavior isn't very good performance wise, as it reloads the filter before each call to the filter whether or not it needs to, it allows for the filter to change dynamically. Possible fixes include adding the ability for filter effects to force a reload of the filter when their attributes change or when they are added or removed. Though in the grand scheme of things I would like to make <filter>s as smart as possible to reduce the amount of reloading needs to be done on changes.
Dirk Schulze
Comment 4
2010-01-01 01:25:20 PST
Created
attachment 45729
[details]
Calculate the filters once, not on every call af applyFilter This patch does not only create the filter effects once, they are also just calculated onece (simuliar to SVG Masker). This is a massive speed up of filters. Not on the first calculation, but on the scrolling or animations. SVGResourceFilter would depend on
bug 33091
like SVGResourceMasker with this bug.
Dirk Schulze
Comment 5
2010-07-01 02:27:04 PDT
This was fixed with moving the filter code to a renderer. Closing the bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug