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
Support CanvasRenderingContext2D.filter #3793
base: main
Are you sure you want to change the base?
Support CanvasRenderingContext2D.filter #3793
Conversation
|
EWS run on previous version of this PR (hash a8c57ff) |
a8c57ff
to
a4e5558
Compare
|
EWS run on previous version of this PR (hash a4e5558) |
a4e5558
to
ee56e3d
Compare
|
EWS run on previous version of this PR (hash ee56e3d) |
ee56e3d
to
e874780
Compare
|
EWS run on previous version of this PR (hash e874780) |
e874780
to
7a2a1cc
Compare
|
EWS run on previous version of this PR (hash 7a2a1cc) |
7a2a1cc
to
9b0fc35
Compare
|
EWS run on previous version of this PR (hash 9b0fc35) |
9b0fc35
to
674c212
Compare
|
any ETA? |
|
Any updates on this? Thanks |
674c212
to
f565fdd
Compare
|
EWS run on previous version of this PR (hash f565fdd)
|
f565fdd
to
30e431f
Compare
|
EWS run on previous version of this PR (hash 30e431f)
|
https://bugs.webkit.org/show_bug.cgi?id=198416 rdar://51303686 Reviewed by NOBODY (OOPS!). This implements the canvas filter API. According to the specs, the filter will be defined as a string very similar to the CSS filter definition. An SVG filter can be accessed via a URL like this `filter : url(#id);`. To implement this feature without many changes in the CanvasRenderingContext2D code, the new class FilterTargetSwitcher will be added. In its constructor we are going to switch the rendering context to a source ImageBuffer. The next draw commands will be drawn to this ImageBuffer. In its destructor, the filter will be applied to the source ImageBuffer and the result will be composited back to the original context. Specs link: https://html.spec.whatwg.org/multipage/canvas.html#canvasfilters * LayoutTests/fast/canvas/canvas-filter-basics-expected.txt: Added. * LayoutTests/fast/canvas/canvas-filter-basics.html: Added. * LayoutTests/fast/canvas/canvas-filter-bounding-rect-expected.html: Added. * LayoutTests/fast/canvas/canvas-filter-bounding-rect.html: Added. * LayoutTests/fast/canvas/canvas-filter-drawing-expected.html: Added. * LayoutTests/fast/canvas/canvas-filter-drawing.html: Added. * LayoutTests/fast/canvas/canvas-filter-repaint-rect-expected.html: Added. * LayoutTests/fast/canvas/canvas-filter-repaint-rect.html: Added. * LayoutTests/fast/canvas/canvas-filter-save-restore-expected.html: Added. * LayoutTests/fast/canvas/canvas-filter-save-restore.html: Added. * LayoutTests/fast/canvas/resources/100x100-green-rect-filter-blur.svg: Added. * LayoutTests/fast/canvas/resources/100x100-green-rect-filter-drop-shadow.svg: Added. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.blur.exceptions-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.colorMatrix-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.discrete-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.gamma-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.identity-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.linear-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.componentTransfer.table-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.canvasFilterObject.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/filters/2d.filter.value-expected.txt: * LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp: (WebCore::CSSPropertyParserWorkerSafe::parseFilterString): * Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.h: * Source/WebCore/html/canvas/CanvasFilterTargetSwitcher.cpp: Added. (WebCore::CanvasFilterTargetSwitcher::CanvasFilterTargetSwitcher): (WebCore::CanvasFilterTargetSwitcher::~CanvasFilterTargetSwitcher): (WebCore::CanvasFilterTargetSwitcher::outsets const): * Source/WebCore/html/canvas/CanvasFilterTargetSwitcher.h: Added. * Source/WebCore/html/canvas/CanvasFilters.idl: * Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setFilterStringWithoutUpdatingStyle): (WebCore::CanvasRenderingContext2D::createFilter const): (WebCore::CanvasRenderingContext2D::calculateFilterOutsets const): * Source/WebCore/html/canvas/CanvasRenderingContext2D.h: * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::State::State): (WebCore::CanvasRenderingContext2DBase::setFilterString): (WebCore::CanvasRenderingContext2DBase::fillInternal): (WebCore::CanvasRenderingContext2DBase::strokeInternal): (WebCore::CanvasRenderingContext2DBase::fillRect): (WebCore::CanvasRenderingContext2DBase::strokeRect): (WebCore::CanvasRenderingContext2DBase::drawImage): (WebCore::CanvasRenderingContext2DBase::drawingContext const): (WebCore::CanvasRenderingContext2DBase::inflatedStrokeRect const): (WebCore::CanvasRenderingContext2DBase::drawTextUnchecked): (WebCore::CanvasRenderingContext2DBase::inflateStrokeRect const): Deleted. * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h: (WebCore::CanvasRenderingContext2DBase::filterString const): (WebCore::CanvasRenderingContext2DBase::setFilterTargetSwitcher): (WebCore::CanvasRenderingContext2DBase::createFilter const): (WebCore::CanvasRenderingContext2DBase::calculateFilterOutsets const): (WebCore::CanvasRenderingContext2DBase::setFilterStringWithoutUpdatingStyle): * Source/WebCore/platform/graphics/FloatRect.h: (WebCore::operator+): * Source/WebCore/platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::copyState): * Source/WebCore/platform/graphics/GraphicsContext.h: * Source/WebCore/platform/graphics/GraphicsContextState.cpp: (WebCore::GraphicsContextState::mergeAllChanges): (WebCore::GraphicsContextState::copyChanges): * Source/WebCore/platform/graphics/GraphicsContextState.h:
30e431f
to
e873cb2
Compare
|
EWS run on current version of this PR (hash e873cb2)
|
|
Any updates? |
e873cb2
e873cb2