Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 13 users
Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 563826
issue 657102
issue 657531

Blocking:
issue 563816



Sign in to add a comment
Implement toBlob on OffscreenCanvas
Project Member Reported by junov@chromium.org, Dec 1 2015 Back to list
Implement the toBlob method on OffscreenCanvas
Note: this one differs from <canvas>.toBlob in that it uses a promise rather than a callback
 
Comment 1 by junov@chromium.org, Dec 1 2015
Blocking: chromium:563816
Comment 2 by xlai@chromium.org, Feb 11 2016
Cc: junov@chromium.org
 Issue 523417  has been merged into this issue.
Project Member Comment 3 by bugdroid1@chromium.org, Aug 22 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aaa6eca6791478e854193a8da307449cd6af0256

commit aaa6eca6791478e854193a8da307449cd6af0256
Author: xlai <xlai@chromium.org>
Date: Mon Aug 22 16:04:15 2016

Determine if OffscreenCanvas is paintable in different rendering contexts

This CL adds isPaintable() to OffscreenCanvas which mimics HTMLCanvasElement::
isPaintable() with some adjustments. Certain common constants and utility
functions shared by OffscreenCanvas and HTMLCanvasElement have been moved to
platform/graphics/. This CL is to facilitate toBlob implementation.

BUG= 563830 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

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

[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
[modify] https://crrev.com/aaa6eca6791478e854193a8da307449cd6af0256/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.h

Comment 4 by xlai@chromium.org, Oct 14 2016
Status: Started
Comment 6 by xlai@chromium.org, Oct 19 2016
Blockedon: 657531
Comment 7 by xlai@chromium.org, Oct 20 2016
Blockedon: 657102
Project Member Comment 8 by bugdroid1@chromium.org, Oct 24 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c9e12fb8f608b3d0e204b167459bf9ea999e068c

commit c9e12fb8f608b3d0e204b167459bf9ea999e068c
Author: xlai <xlai@chromium.org>
Date: Mon Oct 24 21:19:56 2016

Implement convertToBlob() in OffscreenCanvas

This CL implements convertToBlob on OffscreenCanvas for both
worker and main threads.

The OffscreenCanvasRenderingContext2D cases are complete.
For the Webgl rendering context, currently convertToBlob()
can only work for PNG image type.

BUG= 563830 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

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

[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/VirtualTestSuites
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-2d-main-expected.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-2d-main.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-2d-worker-expected.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-2d-worker.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main-expected.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-main.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker-expected.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker.html
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/README.txt
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[add] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/offscreencanvas/ImageEncodeOptions.idl
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.idl
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/c9e12fb8f608b3d0e204b167459bf9ea999e068c/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Comment 9 by xlai@chromium.org, Jan 7 2017
Status: Fixed
All blocked issues are fixed now.
Project Member Comment 10 by bugdroid1@chromium.org, Feb 24 2017
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ce8692f118a0f554fa98574be0c5446b8f0b8fe

commit 5ce8692f118a0f554fa98574be0c5446b8f0b8fe
Author: xlai <xlai@chromium.org>
Date: Fri Feb 24 21:39:52 2017

Handle OffscreenCanvas.convertToBlob exceptions: EncodingError & InvalidStateError

This CL handle two new exceptions:
1. EncodingError exception when convertToBlob fails encoding; the test case we
use here is to attempt encoding webp that exceeds max dimension. This is
consistent with new spec change: https://github.com/whatwg/html/pull/2343
2. InvalidStateError exception when convertToBlob is calling on an OffscreenCanvas
without rendering contexts. Spec change needs to be done later on.

Meanwhile, this CL also fixed crash bug in the corner case when convertToBlob
with webp image type fails.

BUG=659260,  563830 

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

[modify] https://crrev.com/5ce8692f118a0f554fa98574be0c5446b8f0b8fe/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-convertToBlob-exceptions.html
[modify] https://crrev.com/5ce8692f118a0f554fa98574be0c5446b8f0b8fe/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
[modify] https://crrev.com/5ce8692f118a0f554fa98574be0c5446b8f0b8fe/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Sign in to add a comment