Bug 178992 - Implement "bitmaprenderer" CanvasRenderingContext
Summary: Implement "bitmaprenderer" CanvasRenderingContext
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-29 14:04 PDT by Dean Jackson
Modified: 2017-10-30 12:37 PDT (History)
9 users (show)

See Also:


Attachments
Patch (22.41 KB, patch)
2017-10-29 14:17 PDT, Dean Jackson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2017-10-29 14:04:04 PDT
Implement "bitmaprenderer" CanvasRenderingContext
Comment 1 Dean Jackson 2017-10-29 14:04:36 PDT
<rdar://problem/34147157>
Comment 2 Dean Jackson 2017-10-29 14:17:31 PDT
Created attachment 325292 [details]
Patch
Comment 3 Antoine Quint 2017-10-29 14:25:40 PDT
Comment on attachment 325292 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325292&action=review

> Source/WebCore/html/HTMLCanvasElement.cpp:507
> +// FIXME: Needs to accept ImageBitmapRenderingContext::Settings.

Might as well file a bug for this, even if you fix it soon.

> Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp:55
> +    // 1. If a bitmap argument was not provided, then:

I'd prefer a simple link to the spec than copying the entire copy as-is which may end up being stale.
Comment 4 Sam Weinig 2017-10-29 14:33:16 PDT
Comment on attachment 325292 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325292&action=review

> Source/WebCore/html/ImageBitmap.cpp:563
> +    m_detached = true;

Not related to this change, but is the m_detached useful? I would think it always corresponds to whether m_bitmapData is null or not.
Comment 5 Dean Jackson 2017-10-30 11:34:07 PDT
Comment on attachment 325292 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325292&action=review

>> Source/WebCore/html/ImageBitmap.cpp:563
>> +    m_detached = true;
> 
> Not related to this change, but is the m_detached useful? I would think it always corresponds to whether m_bitmapData is null or not.

It might be possible to transfer a null ImageBitmap, although I'm not sure how you'd ever create one.

I think you're right though, so I'll make the change.

>> Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp:55
>> +    // 1. If a bitmap argument was not provided, then:
> 
> I'd prefer a simple link to the spec than copying the entire copy as-is which may end up being stale.

I prefer the specification as comments because:

1. It makes it easier to implement.

2. It makes it easier to review - you don't have to be reading the specification and linking the logic up.

3. It makes it more clear when our implementation gets out of date compared to the specification.
Comment 6 Dean Jackson 2017-10-30 12:37:56 PDT
Committed r224195: <https://trac.webkit.org/changeset/224195>