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

Issue 657531 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 563830



Sign in to add a comment

Complete OffscreenCanvas webgl toImageData for convertToBlob()

Project Member Reported by xlai@chromium.org, Oct 19 2016

Issue description

Complete the rest of the implementation of toImageData() for OffscreenCanvas webgl rendering context. In particular, currently the jpeg and webp image cannot be rendered.


 

Comment 1 by xlai@chromium.org, Oct 19 2016

Blocking: 563830
Cc: xidac...@chromium.org junov@chromium.org
I could be wrong, but I thought this part of code:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp?sq=package:chromium&rcl=1476847656&l=651

does the implementation for WebGL's toImageData?

Comment 3 by xlai@chromium.org, Oct 20 2016

Oh, this is actually part of the code in my CL https://codereview.chromium.org/2420203002/.

I implemented toImageData for both webgl and 2d for OffscreenCanvas. But the
part for webgl only works for PNG image type. So I put a TODO there
with a bug to mark it.

Comment 4 by xlai@chromium.org, Oct 20 2016

Summary: Complete OffscreenCanvas webgl toImageData for convertToBlob() (was: OffscreenCanvas webgl toImageData)

Comment 5 by xlai@chromium.org, Oct 20 2016

Description: Show this description
Project Member

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

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

commit 7922f33fe97e510c7259ebc077bd04ea2657e704
Author: xlai <xlai@chromium.org>
Date: Wed Jan 04 23:37:21 2017

Fixed WebglRenderingContextBase toImageData

Previously, WebglRenderingContextBase::toImageData(), which is used by convertToBlob,
wrongly used DrawingBuffer::transferToStaticBitmapImage() to obtain the image data.
This results in black image when toImageData() is called back-to-back, because
transferToStaticBitmapImage() discards the backbuffer when preserveDrawingBuffer
(a user-set flag) is false.

The new implementation in this patch follows what HTMLCanvasElement::toImageData do;
but it removes all unnecessary steps in HTMLCanvasElement that deals with
ImageBuffer(Surface) and other extra steps that do not apply to OffscreenCanvas,
and also handles the additional situation when toImageData can be called on
worker thread.

BUG= 657531 
CQ_INCLUDE_TRYBOTS=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/2602253002
Cr-Commit-Position: refs/heads/master@{#441511}

[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main-expected.html
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main.html
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker-expected.html
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker.html
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/webgl/DEPS
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/7922f33fe97e510c7259ebc077bd04ea2657e704/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Comment 7 by xlai@chromium.org, Jan 5 2017

Owner: xlai@chromium.org
Status: Fixed (was: Available)

Sign in to add a comment