Last Comment Bug 748433 - Extend Canvas compositing with blend modes
: Extend Canvas compositing with blend modes
Status: RESOLVED FIXED
[DocArea=Canvas]
: dev-doc-complete
Product: Core
Classification: Components
Component: Canvas: 2D (show other bugs)
: Trunk
: x86_64 All
: -- enhancement (vote)
: mozilla20
Assigned To: Rik Cabanier
:
Mentors:
Depends on: 809927
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-24 10:29 PDT by Rik Cabanier (don't use this account)
Modified: 2014-10-15 10:29 PDT (History)
13 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
this patch implements blending in canvas for software and core graphics (15.35 KB, patch)
2012-04-25 14:06 PDT, Rik Cabanier (don't use this account)
no flags Details | Diff | Splinter Review
this patch implements blending in canvas for software and core graphics (13.69 KB, patch)
2012-04-25 14:08 PDT, Rik Cabanier (don't use this account)
no flags Details | Diff | Splinter Review
this patch implements blending in canvas for software and core graphics (13.69 KB, patch)
2012-04-25 14:11 PDT, Rik Cabanier (don't use this account)
jmuizelaar: review+
Details | Diff | Splinter Review
patch for CG and software. Direct2D to follow as separate patch (11.22 KB, patch)
2012-11-08 11:50 PST, Rik Cabanier
no flags Details | Diff | Splinter Review
Adds support for blending to canvas. 809927 needs to be submitted first (10.03 KB, patch)
2012-11-18 16:44 PST, Rik Cabanier
jmuizelaar: review+
Details | Diff | Splinter Review
Tests for canvas blending (93.29 KB, patch)
2012-11-19 12:55 PST, Rik Cabanier
no flags Details | Diff | Splinter Review
Added testfiles for Canvas Blending (83.53 KB, patch)
2012-11-19 14:25 PST, Rik Cabanier
jmuizelaar: review+
Details | Diff | Splinter Review

Description Rik Cabanier (don't use this account) 2012-04-24 10:29:53 PDT
I work for Adobe and am working on extending CSS and Canvas with blend modes such as overlay, color-burn, hue, etc.
As part of getting this accepted for the Canvas spec, I need to put an experimental version in a couple of browser. 
I'm working on getting this submitted to WebKit but also want to add it for FireFox.

I already have made the necessary changes to the mozilla code base that implement this. (It was easy since the blending modes are already there.)

The formulas for the blending modes are documented here: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending
and a proposal for canvas here: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#canvascompositingandblending
Comment 1 Rik Cabanier (don't use this account) 2012-04-25 14:06:17 PDT
Created attachment 618428 [details] [diff] [review]
this patch implements blending in canvas for software and core graphics
Comment 2 Rik Cabanier (don't use this account) 2012-04-25 14:08:41 PDT
Created attachment 618429 [details] [diff] [review]
this patch implements blending in canvas for software and core graphics
Comment 3 Rik Cabanier (don't use this account) 2012-04-25 14:11:03 PDT
Created attachment 618432 [details] [diff] [review]
this patch implements blending in canvas for software and core graphics
Comment 4 Jeff Muizelaar [:jrmuizel] 2012-05-03 12:40:50 PDT
Comment on attachment 618432 [details] [diff] [review]
this patch implements blending in canvas for software and core graphics

Review of attachment 618432 [details] [diff] [review]:
-----------------------------------------------------------------

In principle this seems ok. I'd like to see how it works out with D2D before we land it though. It will also need tests.
Comment 5 Rik Cabanier (don't use this account) 2012-05-03 13:17:17 PDT
We will provide the tests for the W3C.
Either FF or Adobe could add them to your test suite.
Comment 6 Rik Cabanier (don't use this account) 2012-05-11 03:44:12 PDT
There's a conversation on the WebGL mailing list that talks about this: https://www.khronos.org/webgl/public-mailing-list/archives/1205/msg00115.html
I think it is possible to implement this in a similar way in Direct3D.

Looking at your code, you always seem to have access to the Direct3D world so you could set up an  intermediate texture to do the blending.
Comment 7 Rik Cabanier (don't use this account) 2012-05-11 03:46:00 PDT
Also, if you want to special case win8, blending is supported natively there: http://msdn.microsoft.com/en-us/library/windows/desktop/hh706313(v=vs.85).aspx
Comment 8 Rik Cabanier 2012-11-08 11:50:52 PST
Created attachment 679769 [details] [diff] [review]
patch for CG and software. Direct2D to follow as separate patch

Once this patch is approved, I can implement the patch for Direct2D
Comment 9 Rik Cabanier 2012-11-18 16:44:58 PST
Created attachment 682952 [details] [diff] [review]
Adds support for blending to canvas. 809927 needs to be submitted first
Comment 10 Rik Cabanier 2012-11-19 12:55:01 PST
Created attachment 683278 [details] [diff] [review]
Tests for canvas blending
Comment 11 Rik Cabanier 2012-11-19 14:25:44 PST
Created attachment 683307 [details] [diff] [review]
Added testfiles for Canvas Blending
Comment 12 Jeff Muizelaar [:jrmuizel] 2012-11-19 14:38:51 PST
Comment on attachment 682952 [details] [diff] [review]
Adds support for blending to canvas. 809927 needs to be submitted first

Review of attachment 682952 [details] [diff] [review]:
-----------------------------------------------------------------

This seems fine.
Comment 13 Ryan VanderMeulen [:RyanVM] 2012-11-19 18:57:00 PST
Pushed to Try:
https://tbpl.mozilla.org/?tree=Try&rev=ee59dfe33091
Comment 14 Jeff Muizelaar [:jrmuizel] 2012-11-19 19:21:48 PST
This should wait for the tests to be r+ed
Comment 15 Rik Cabanier 2012-11-19 19:56:43 PST
(In reply to Jeff Muizelaar [:jrmuizel] from comment #14)
> This should wait for the tests to be r+ed

Can you review the tests?
Comment 16 Ryan VanderMeulen [:RyanVM] 2012-11-20 06:06:18 PST
(In reply to Jeff Muizelaar [:jrmuizel] from comment #14)
> This should wait for the tests to be r+ed

Looks like the tests are failing (see the Windows opt/debug mochitest-1 results).
Comment 17 Daniel Holbert [:dholbert] 2012-11-20 15:42:14 PST
Earlier today I pushed this to try w/ updated patch from bug 809927, at cabanier's request:
  https://tbpl.mozilla.org/?tree=Try&rev=1eb5097847b3
Looks like we've still got some Win opt/debug mochitest-1 failures.
Comment 18 Ryan VanderMeulen [:RyanVM] 2012-11-20 19:13:13 PST
Pushed to Try with an updated patch from bug 809927:
https://tbpl.mozilla.org/?tree=Try&rev=b3fb0a2665ab
Comment 19 Ryan VanderMeulen [:RyanVM] 2012-11-21 19:25:54 PST
New Try run: https://tbpl.mozilla.org/?tree=Try&rev=c50a7872fa9d
Comment 20 Jeff Muizelaar [:jrmuizel] 2012-11-22 08:17:34 PST
Comment on attachment 683307 [details] [diff] [review]
Added testfiles for Canvas Blending

Review of attachment 683307 [details] [diff] [review]:
-----------------------------------------------------------------

I was hoping to review this before going on vacation but I didn't get a chance to. I'll be back in about a week. If you're in a hurry you can try to get someone else to review it.
Comment 21 Ryan VanderMeulen [:RyanVM] 2012-11-22 21:06:16 PST
https://tbpl.mozilla.org/?tree=Try&rev=7f6e86970acc
Comment 22 Ryan VanderMeulen [:RyanVM] 2012-11-23 14:50:06 PST
https://tbpl.mozilla.org/?tree=Try&rev=245d38c91824
Comment 25 :Ms2ger 2012-12-13 14:00:08 PST
Has this been discussed in the WHATWG?
Comment 26 Rik Cabanier 2012-12-13 16:24:54 PST
(In reply to :Ms2ger from comment #25)
> Has this been discussed in the WHATWG?

yes. I brought this up a while ago. Ian advised that the best course of action was to get it in the browsers.
WebKit already is parsing the new keywords and I have a patch ready for Safari to implement this.

In addition, there are more recent discussion about these new property values on public-fx and webkit-dev.

Note You need to log in before you can comment on or make changes to this bug.