Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Issue 2768683002: Fix unreliable MediaStream capture from WebGL canvases (Closed)

Created:
3 years, 9 months ago by Justin Novosad
Modified:
3 years, 8 months ago
Reviewers:
emircan, xlai (Olivia)
CC:
chromium-reviews, dshwang, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, mcasas+capturefromelement_chromium.org, dglazkov+blink, Rik, blink-reviews, emircan+watch+capturefromdom_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix unreliable MediaStream capture from WebGL canvases When capturing a MediaStrem from a WebGL canvas that has the preserveDrawingBuffer option set to false, it is important to perform the frame capture before the canvas is cleared by the buffer swap mechanism. This change resolves the issue by performing the capture during the paint invalidation phase instead of during frame finalization. For canvases that are not visible on screen, there is no paint invalidation, which is a problem. So in that case, we fall back to doing the capture during frame finalization, which is okay in that case because there is no buffer swap. BUG=702446 Review-Url: https://codereview.chromium.org/2768683002 Cr-Commit-Position: refs/heads/master@{#460159} Committed: https://chromium.googlesource.com/chromium/src/+/7b09536cad07c7983eac63eac07ecf82f53c65d1

Patch Set 1 #

Patch Set 2 : comment typo fix #

Patch Set 3 : fix test flakiness #

Patch Set 4 : simplify test by removing WebRTC connection #

Total comments: 2

Patch Set 5 : Replace LayoutTest with browser test #

Patch Set 6 : Boost test tolerance to make it pass on MacOS 10.9 #

Patch Set 7 : mac suppress #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -26 lines) Patch
M content/browser/webrtc/webrtc_capture_from_element_browsertest.cc View 1 2 3 4 5 6 1 chunk +13 lines, -2 lines 0 comments Download
M content/test/data/media/canvas_capture_color.html View 1 2 3 4 5 6 4 chunks +72 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 chunks +14 lines, -1 line 0 comments Download

Messages

Total messages: 45 (27 generated)
Justin Novosad
@emircan: please review the test @xlai: please review the code
3 years, 9 months ago (2017-03-21 22:24:23 UTC) #4
xlai (Olivia)
Also is there a scenario when canvas becomes visible and invisible back and forth? If ...
3 years, 9 months ago (2017-03-22 17:06:21 UTC) #11
Justin Novosad
On 2017/03/22 17:06:21, xlai (Olivia) wrote: > Also is there a scenario when canvas becomes ...
3 years, 9 months ago (2017-03-22 17:20:50 UTC) #12
xlai (Olivia)
On 2017/03/22 17:20:50, Justin Novosad wrote: > On 2017/03/22 17:06:21, xlai (Olivia) wrote: > > ...
3 years, 9 months ago (2017-03-22 18:01:29 UTC) #15
emircan
https://codereview.chromium.org/2768683002/diff/60001/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-preservedrawingbuffer-false.html File third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-preservedrawingbuffer-false.html (right): https://codereview.chromium.org/2768683002/diff/60001/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-preservedrawingbuffer-false.html#newcode36 third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-preservedrawingbuffer-false.html:36: testCtx.drawImage(video, 0, 0); Sorry I forgot about this earlier ...
3 years, 9 months ago (2017-03-22 18:26:27 UTC) #16
Justin Novosad
On 2017/03/22 18:26:27, emircan wrote: > https://codereview.chromium.org/2768683002/diff/60001/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-preservedrawingbuffer-false.html > File > third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-preservedrawingbuffer-false.html > (right): > > ...
3 years, 9 months ago (2017-03-22 18:40:54 UTC) #17
Justin Novosad
@emircan: I changed the test.
3 years, 9 months ago (2017-03-22 20:58:46 UTC) #20
emircan
On 2017/03/22 20:58:46, Justin Novosad wrote: > @emircan: I changed the test. lgtm. Thank you ...
3 years, 9 months ago (2017-03-22 21:20:58 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2768683002/80001
3 years, 9 months ago (2017-03-23 14:00:52 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/413237)
3 years, 9 months ago (2017-03-23 15:31:20 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2768683002/100001
3 years, 9 months ago (2017-03-23 15:42:51 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/178495)
3 years, 9 months ago (2017-03-23 16:50:33 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2768683002/100001
3 years, 9 months ago (2017-03-23 18:08:49 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/413456)
3 years, 9 months ago (2017-03-23 20:23:49 UTC) #37
Justin Novosad
There is definitely something wrong on mac. More investigation is needed.
3 years, 9 months ago (2017-03-24 17:29:53 UTC) #38
Justin Novosad
On 2017/03/24 17:29:53, Justin Novosad wrote: > There is definitely something wrong on mac. More ...
3 years, 8 months ago (2017-03-28 15:19:43 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2768683002/120001
3 years, 8 months ago (2017-03-28 16:04:25 UTC) #42
commit-bot: I haz the power
3 years, 8 months ago (2017-03-28 17:48:19 UTC) #45
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/7b09536cad07c7983eac63eac07e...

Powered by Google App Engine
This is Rietveld 408576698