Bug 178992

Summary: Implement "bitmaprenderer" CanvasRenderingContext
Product: WebKit Reporter: Dean Jackson <dino>
Component: CanvasAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, dino, esprehn+autocc, graouts, gyuyoung.kim, kondapallykalyan, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch sam: review+

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>