Closed Bug 748433 Opened 12 years ago Closed 11 years ago

Extend Canvas compositing with blend modes

Categories

(Core :: Graphics: Canvas2D, enhancement)

x86_64
All
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: cabanier, Assigned: cabanier)

References

Details

(Keywords: dev-doc-complete, Whiteboard: [DocArea=Canvas])

Attachments

(2 files, 5 obsolete files)

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
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #618428 - Attachment is obsolete: true
Attachment #618429 - Attachment is patch: true
Attachment #618429 - Attachment is obsolete: true
Attachment #618432 - Flags: review?(jmuizelaar)
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.
Attachment #618432 - Flags: review?(jmuizelaar) → review+
We will provide the tests for the W3C.
Either FF or Adobe could add them to your test suite.
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.
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
Blocks: 809927
Once this patch is approved, I can implement the patch for Direct2D
Attachment #679769 - Flags: review?(jmuizelaar)
Attachment #679769 - Attachment is patch: true
Attachment #679769 - Flags: review?(jmuizelaar)
No longer blocks: 809927
Depends on: 809927
Attachment #679769 - Attachment is obsolete: true
Attachment #682952 - Attachment is patch: true
Attached patch Tests for canvas blending (obsolete) — Splinter Review
Attachment #683278 - Flags: review?(jmuizelaar)
Attachment #682952 - Attachment is obsolete: true
Attachment #682952 - Flags: review?(jmuizelaar)
Attachment #682952 - Attachment is obsolete: false
Attachment #683278 - Attachment is obsolete: true
Attachment #683278 - Flags: review?(jmuizelaar)
Attachment #682952 - Flags: review?(jmuizelaar)
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.
Attachment #682952 - Flags: review?(jmuizelaar) → review+
Attachment #683307 - Flags: review?(jmuizelaar)
Attachment #618432 - Attachment is obsolete: true
This should wait for the tests to be r+ed
Keywords: checkin-needed
(In reply to Jeff Muizelaar [:jrmuizel] from comment #14)
> This should wait for the tests to be r+ed

Can you review the tests?
(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).
Attachment #683307 - Attachment description: Fixed makefile → Added testfiles for Canvas Blending
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.
Flags: needinfo?(ryanvm)
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.
Flags: needinfo?(ryanvm)
Flags: needinfo?(ryanvm)
Attachment #683307 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/3a8b188873f8
https://hg.mozilla.org/mozilla-central/rev/362510d94a1b
Assignee: nobody → cabanier
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Has this been discussed in the WHATWG?
(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.
Severity: normal → enhancement
Keywords: dev-doc-needed
Whiteboard: [DocArea=Canvas]
You need to log in before you can comment on or make changes to this bug.