Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[canvaskit] Decode images using <img> tag decoding #53201

Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift click to select a range
49ed8d4
Use HtmlImageElement for image decoding in skia
harryterkelsen May 24, 2024
6b248d1
start touching up tests
harryterkelsen May 29, 2024
d780fe3
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen May 29, 2024
4e43312
eagerly decode
harryterkelsen May 31, 2024
9b1a448
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen May 31, 2024
e6d4d44
wip
harryterkelsen Jun 4, 2024
8ea4865
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jun 4, 2024
88d685d
wip
harryterkelsen Jul 2, 2024
23cb86b
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jul 2, 2024
7883559
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jul 3, 2024
8a1a7ce
WIP
harryterkelsen Jul 10, 2024
389369d
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jul 10, 2024
d900ded
Fix ImageBitmap toByteData case
harryterkelsen Jul 11, 2024
355891b
Fall back to Skia decoding for GIF and WEBP images
harryterkelsen Jul 11, 2024
cfc1c4a
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jul 11, 2024
d317302
Undo semantics change
harryterkelsen Jul 11, 2024
c579c8e
Remove unused readImageElementPixelsUnmodified method
harryterkelsen Jul 11, 2024
dd5c8d6
remove outdated comment in test
harryterkelsen Jul 11, 2024
f3997c1
delete old unused tests
harryterkelsen Jul 11, 2024
52b8330
fix analysis errors
harryterkelsen Jul 11, 2024
b207ee7
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jul 16, 2024
4f5f863
Merge branch 'main' into pr/harryterkelsen/53201
harryterkelsen Jul 17, 2024
7c6ab13
Respond to review comments
harryterkelsen Jul 17, 2024
0b426fe
Merge branch 'main' into canvaskit-html-img-element-decode
harryterkelsen Jul 18, 2024
c06797c
Merge branch 'canvaskit-html-img-element-decode' of github.com:harryt…
harryterkelsen Jul 18, 2024
e7aff46
Remove unnecessary `await`
harryterkelsen Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused readImageElementPixelsUnmodified method
  • Loading branch information
harryterkelsen committed Jul 11, 2024
commit c579c8ef9c8d4c4b2216348b2049b421cca3369a
13 changes: 0 additions & 13 deletions lib/web_ui/lib/src/engine/canvaskit/image_web_codecs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 193,6 @@ Future<ByteBuffer> readVideoFramePixelsUnmodified(VideoFrame videoFrame) async {
return destination.toDart.buffer;
}

ByteBuffer readImageElementPixelsUnmodified(DomHTMLImageElement imageElement) {
final int width = imageElement.naturalWidth.toInt();
final int height = imageElement.naturalHeight.toInt();

final DomCanvasElement htmlCanvas =
createDomCanvasElement(width: width, height: height);
final DomCanvasRenderingContext2D ctx =
htmlCanvas.getContext('2d')! as DomCanvasRenderingContext2D;
ctx.drawImage(imageElement, 0, 0);
final DomImageData imageData = ctx.getImageData(0, 0, width, height);
return imageData.data.buffer;
}

ByteBuffer readDomImageSourcePixelsUnmodified(
DomCanvasImageSource imageSource, int width, int height) {
final DomCanvasElement htmlCanvas =
Expand Down