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

Issue 696224 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 585607
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

[OffscreenCanvas] Poor performance with transferFromImageBitmap()

Reported by a...@scirra.com, Feb 25 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3023.0 Safari/537.36

Steps to reproduce the problem:
1. Visit https://www.scirra.com/labs/bugs/bitmaprenderer-slow/
2. Observe timing information beneath the canvas

What is the expected behavior?
The demo renders to a WebGL context created from an OffscreenCanvas in a requestAnimationFrame loop. Every frame it calls offscreenCanvas.transferToImageBitmap(), then passes the resulting ImageBitmap to a "bitmaprenderer" canvas context's transferFromImageBitmap(). It measures how long the call to transferFromImageBitmap() takes on average.

What went wrong?
It often takes 15-20ms for the transferFromImageBitmap() call alone. This is too slow for the feature to be useful.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3023.0  Channel: canary
OS Version: 10.0
Flash Version: Shockwave Flash 25.0 r0

In Firefox Nightly the call takes on average 0.05ms.
 

Comment 1 by a...@scirra.com, Feb 25 2017

Forgot to mention: note you have to enable 'experimental canvas features' in chrome://flags

Comment 2 by ajha@chromium.org, Feb 27 2017

Labels: Needs-Triage-M58

Comment 3 by junov@chromium.org, Feb 27 2017

Owner: junov@chromium.org
Status: Assigned (was: Unconfirmed)
Hmm... This is definitely unexpected. This should be near instantaneous. It is supposed to be a zero-copy code path. 

Comment 4 by junov@chromium.org, Mar 22 2017

Labels: -Needs-Triage-M58 M-59

Comment 5 by junov@chromium.org, Mar 22 2017

Mergedinto: 585607
Status: Duplicate (was: Assigned)
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 6 2017

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

commit 300bd53cd8a10fd63b4362b52bb6b6b92e345821
Author: junov <junov@chromium.org>
Date: Thu Apr 06 21:49:10 2017

Streamline the presentation of ImageBitmapRenderingContext

This change adds an ImageLayerBridge class that provides a direct
compositing path for displaying ImageBitmap objects, without
going through a blink paint pass.  As a consequence, there are
no more GPU readbacks when the source of the image is
GPU-accelerated.

In canvas rendering context classes, the notion of being
accelerated had to be decoupled from the notion of being
composited.  This is because non-accelerated canvases are
are directly composited with ImageBitmapRenderingContext.

BUG= 696224 ,  585607 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

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

[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/content/test/gpu/gpu_tests/pixel_expectations.py
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/content/test/gpu/gpu_tests/pixel_test_pages.py
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
[add] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/PerformanceTests/Canvas/transferFromImageBitmap.html
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/frame/ImageBitmap.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/html/HTMLCanvasElement.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/paint/HTMLCanvasPainter.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
[add] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/platform/graphics/gpu/ImageLayerBridge.cpp
[add] https://crrev.com/300bd53cd8a10fd63b4362b52bb6b6b92e345821/third_party/WebKit/Source/platform/graphics/gpu/ImageLayerBridge.h

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 7 2017

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

commit c691ffcd4824ed498763b46ef9378d639ae1ab41
Author: junov <junov@chromium.org>
Date: Fri Apr 07 20:37:35 2017

Remove supressions for rebaselined gpu pixel tests

Affected tests:
Pixel_OffscreenCanvasTransferToImageBitmap
Pixel_OffscreenCanvasTransferToImageBitmapWorker

BUG= 696224 ,  585607 
TBR=xlai@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

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

[modify] https://crrev.com/c691ffcd4824ed498763b46ef9378d639ae1ab41/content/test/gpu/gpu_tests/pixel_expectations.py

Sign in to add a comment