New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GPU Process] [Filters] Cache the SVGFilter applying results in RemoteResourceCache #13814
Conversation
a59ad65
to
cb8d4f1
Compare
I don't think the "22/23" is useful. |
cb8d4f1
to
3e2cdfb
Compare
EWS run on previous version of this PR (hash 3e2cdfb) |
EWS run on previous version of this PR (hash cb8d4f1) |
3e2cdfb
to
0df44f4
Compare
EWS run on previous version of this PR (hash 0df44f4) |
class FilterEffect; | ||
|
||
struct SVGFilterTransactionItem { | ||
unsigned index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index into what? This isn't the index in this Vector<>, right?
It's a bit confusing to use these vectors for SVG filters, where the filter structure is a graph, and more confusing to have this standalone structure that contains indexes into something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an index to the SVGFilter::m_effects
which is a Vector of the unique effects in the SVGFilter
graph. The order of the effects in WebProcess and GPUProcess is the same. This is why when a certain FilterEffect
changes in WebProcess we lookup its index in SVGFilter::m_effects
and send it with this index to GPUProcess in SVGFilterTransaction
. Using this index, GPUProcess will replace this effect in SVGFilter::m_effects
and delete its FilterImage
along with the result of all the dependent FilterEffects
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SVGFilterExpression
represents the graph of the SVGFilter
. It is a Vector of SVGFilterExpressionTerm
. Each SVGFilterExpressionTerm
has an index pointing to the SVGFilter::m_effects
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can package up SVGFilterExpression and SVGFilterTransaction into one struct, so we don't have these dangling indexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can send the whole SVGFilter to GPUP and merge the new effects with the old cached one. If an effect does not match its cached corresponding one, we replace the old with the new and we clear the result and all the dependent results of this effect.
0df44f4
to
35b38f0
Compare
EWS run on previous version of this PR (hash 35b38f0) |
35b38f0
to
cd149b1
Compare
EWS run on current version of this PR (hash cd149b1) |
EWS run on previous version of this PR (hash cd149b1) |
return; | ||
} | ||
|
||
RefPtr cahcedFilter = resourceCache().cachedFilter({ filter->renderingResourceIdentifier(), m_webProcessIdentifier }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cahcedFilter"
} | ||
|
||
RefPtr cahcedFilter = resourceCache().cachedFilter({ filter->renderingResourceIdentifier(), m_webProcessIdentifier }); | ||
if (!cahcedFilter || !is<SVGFilter>(*cahcedFilter)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a single dynamicDowncast<>
cd149b1
to
48a0df2
Compare
EWS run on current version of this PR (hash 48a0df2) |
48a0df2
to
8e47cee
Compare
β¦eResourceCache https://bugs.webkit.org/show_bug.cgi?id=232845 rdar://85426641 Reviewed by Simon Fraser. This allows caching the results of applying an SVGFilter to a source ImageBuffer in GPU Process. We should be able to use the cached result if the Filter was not changed. We should be also able to clear some of the result FilterImages if a FilterEffect was changed. * Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): * Source/WebCore/svg/graphics/filters/SVGFilter.cpp: (WebCore::SVGFilter::mergeEffects): * Source/WebCore/svg/graphics/filters/SVGFilter.h: * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawFilteredImageBufferInternal): (WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer): * Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h: * Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: (WebKit::RemoteDisplayListRecorderProxy::recordDrawFilteredImageBuffer): Canonical link: https://commits.webkit.org/264087@main
8e47cee
to
b686ba4
Compare
Committed 264087@main (b686ba4): https://commits.webkit.org/264087@main Reviewed commits have been landed. Closing PR #13814 and removing active labels. |
b686ba4
48a0df2
π wincairoπ§ͺ wpe-wk2π§ͺ ios-wk2-wptπ§ͺ gtk-wk2π§ͺ api-iosπ watch-sim