New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 593838 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Support canvas filters on OffscreenCanvas 2d contexts

Project Member Reported by junov@chromium.org, Mar 10 2016

Issue description

Support canvas filters on OffscreenCanvas 2d contexts
 

Comment 1 by junov@chromium.org, Apr 4 2016

Owner: xlai@chromium.org

Comment 3 by junov@chromium.org, Aug 31 2016

Cc: zakerinasab@chromium.org xlai@chromium.org
Owner: fs...@chromium.org
The next step is to make filters work when in a Worker.
The difficult part is parsing the filter string, which relies on the CSS parser.  The CSS parser was not designed to be invoked off the main thread because style evaluation always happens on the main thread.  We had a similar problem with evaluating color values off the main thread.  

For colors we had to make CSSValuePool thread local (other option would have been to make it thread safe). https://codereview.chromium.org/1870503002/

For filters we will need to not support reference filters when in a worker since we do not have access to the DOM.  This means that using the "url()" filter markup must fail silently.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ee25559e75c9fa03648b4fcaf52f162baa243d2a

commit ee25559e75c9fa03648b4fcaf52f162baa243d2a
Author: fserb <fserb@chromium.org>
Date: Mon Jan 30 19:00:09 2017

This adds support for filter on OffScreen canvas.

Most of those changes are due to offscreen canvas not having access to a Document,
that is needed by CSS filter parser.

Also, filter(url) are still no-ops.

BUG= 593838 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2326633002
Cr-Commit-Position: refs/heads/master@{#447023}

[delete] https://crrev.com/efa2fe86ca1c0ec34d1ddd3ae72fcdceb62a3129/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-filter.html
[add] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter-expected.html
[add] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter-in-worker-expected.html
[add] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter-in-worker.html
[add] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-filter.html
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.h
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/core/paint/FilterEffectBuilder.cpp
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/core/paint/FilterEffectBuilder.h
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.h
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/ee25559e75c9fa03648b4fcaf52f162baa243d2a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl

Comment 5 by fs...@chromium.org, Jan 30 2017

Status: Fixed (was: Assigned)
I think this closes the bulk of the work. When we find issues, I'll track it in separate bugs. 
\o/
Project Member

Comment 7 by bugdroid1@chromium.org, Feb 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/57b186697a33b7e1eb969995fd9174d9a43048fa

commit 57b186697a33b7e1eb969995fd9174d9a43048fa
Author: fs <fs@opera.com>
Date: Tue Feb 14 16:20:14 2017

Actually delegate in additional FilterEffectBuilder constructor

Because url(...) filters are ignored/dropped this will not have any
practical effect, but could avoid issues in the future.

BUG= 593838 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2692883003
Cr-Commit-Position: refs/heads/master@{#450374}

[modify] https://crrev.com/57b186697a33b7e1eb969995fd9174d9a43048fa/third_party/WebKit/Source/core/paint/FilterEffectBuilder.cpp

Sign in to add a comment