Bug 165086 - Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern and drawImage
Summary: Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-27 16:43 PST by Sam Weinig
Modified: 2016-11-28 17:04 PST (History)
5 users (show)

See Also:


Attachments
Patch (19.14 KB, patch)
2016-11-27 16:45 PST, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (19.61 KB, patch)
2016-11-28 10:41 PST, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (19.66 KB, patch)
2016-11-28 15:28 PST, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2016-11-27 16:43:25 PST
Make CanvasRenderingContext2D use WebIDL unions / Variants for createPattern and drawImage
Comment 1 Sam Weinig 2016-11-27 16:45:31 PST
Created attachment 295475 [details]
Patch
Comment 2 Chris Dumez 2016-11-28 09:16:54 PST
Comment on attachment 295475 [details]
Patch

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

r=me but please check GTK/EFL build.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:137
> +    // FIXME: All the unrestricted float arguments below should be unrestricted doubles.

I think we can get away with doing this change in tis patch (only in the IDL).
Comment 3 Darin Adler 2016-11-28 09:19:51 PST
Comment on attachment 295475 [details]
Patch

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

Some compilation problems with gcc on the GTK and EFL bots. Not sure what’s going on there. Maybe [&] isn’t supposed to capture "this"?

> Source/WebCore/html/canvas/CanvasRenderingContext2D.h:58
> +using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>>;

So sad that these all have to be RefPtr, when none are allowed to be null.
Comment 4 Sam Weinig 2016-11-28 10:41:02 PST
Created attachment 295501 [details]
Patch
Comment 5 Sam Weinig 2016-11-28 15:28:38 PST
Created attachment 295539 [details]
Patch
Comment 6 Sam Weinig 2016-11-28 15:42:33 PST
(In reply to comment #3)
> Comment on attachment 295475 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=295475&action=review
> 
> Some compilation problems with gcc on the GTK and EFL bots. Not sure what’s
> going on there. Maybe [&] isn’t supposed to capture "this"?

It's a GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636) I can work around it using an explicit this->.

> 
> > Source/WebCore/html/canvas/CanvasRenderingContext2D.h:58
> > +using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>>;
> 
> So sad that these all have to be RefPtr, when none are allowed to be null.

Yeah, it's something I would like to improve at some point, but I am not quite sure how yet.
Comment 7 Sam Weinig 2016-11-28 17:04:05 PST
Committed r209048: <http://trac.webkit.org/changeset/209048>