support SVG as input for createImageBitmap |
||||
Issue descriptionA pull request is here: https://github.com/whatwg/html/issues/923 to get feedback about whether we should support SVG as input for createImageBitmap or not.
,
Apr 1 2016
,
Apr 1 2016
It'd be amazing if the crop params could be used to optimise this too. As in, use the crop information to avoid painting stuff that would be out of view.
,
Apr 1 2016
Let's definitely keep that in mind. If that optimization is too involved to put in the initial CL, we should file a separate issue for it.
,
Apr 15 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1 commit 04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1 Author: xidachen <xidachen@chromium.org> Date: Fri Apr 15 16:09:10 2016 Support createImageBitmap from a SVG image Right now when call createImageBitmap from a SVG image, it will throw a InvalidStateError. This CL changes such that creating an ImageBitmap from a SVG image is supported. This CL includes two layout tests for the case of an SVG image with and without intrinsic size. The spec here: https://html.spec.whatwg.org/#imagebitmapfactories states that createImageBitmap should throw an InvalidStateError when the SVG image doesn't have an intrinsic size. BUG= 599228 Review URL: https://codereview.chromium.org/1890613002 Cr-Commit-Position: refs/heads/master@{#387612} [add] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg-expected.txt [add] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg-no-intrinsic-size-expected.txt [add] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg-no-intrinsic-size.html [add] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg.html [modify] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp [modify] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp [modify] https://crrev.com/04c55bfcb5eeb705f7d29a16c72fea6e9737a5b1/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
,
Apr 21 2016
,
Apr 21 2016
Whoa! Quick work! Does this work from workers? Does it optimise for cropping? (See #3) Looking forward to playing with this.
,
Apr 21 2016
jaffathecake@: Not yet from a worker. You can do things like this:
var img = new Image();
img.onload = function() {
createImageBitmap(img);
}
img.src = 'xxx.svg';
,
Apr 25 2016
Created https://bugs.chromium.org/p/chromium/issues/detail?id=606317 for in-worker usage |
||||
►
Sign in to add a comment |
||||
Comment 1 by junov@chromium.org
, Apr 1 2016