Bug 147337 - PathApplierFunction should take a reference to a PathElement
Summary: PathApplierFunction should take a reference to a PathElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-27 16:23 PDT by Simon Fraser (smfr)
Modified: 2015-07-28 22:07 PDT (History)
2 users (show)

See Also:


Attachments
Patch (17.96 KB, patch)
2015-07-27 16:24 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (19.78 KB, patch)
2015-07-27 18:27 PDT, Simon Fraser (smfr)
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-07-27 16:23:15 PDT
PathApplierFunction should take a reference to a PathElement
Comment 1 Simon Fraser (smfr) 2015-07-27 16:24:07 PDT
Created attachment 257610 [details]
Patch
Comment 2 Simon Fraser (smfr) 2015-07-27 18:27:34 PDT
Created attachment 257624 [details]
Patch
Comment 3 Daniel Bates 2015-07-27 18:55:11 PDT
Comment on attachment 257624 [details]
Patch

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

Obviously, we need to rebase this patch before landing.

> Source/WebCore/platform/graphics/cg/PathCG.cpp:383
> +static void CGPathApplierToPathApplier(void *info, const CGPathElement* element)

We should also fix up the position of the '*' in the first argument.
Comment 4 Simon Fraser (smfr) 2015-07-28 11:23:54 PDT
https://trac.webkit.org/r187492
Comment 5 Darin Adler 2015-07-28 11:26:51 PDT
Comment on attachment 257624 [details]
Patch

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

> Source/WebCore/platform/graphics/Path.h:83
> +    typedef void (*PathApplierFunction)(void* info, const PathElement&);

We should come back here and change this to be:

    typedef std::function<void (const PathElement&)> PathApplierFunction;

Cleaner to use std::function instead of void*.
Comment 6 Simon Fraser (smfr) 2015-07-28 22:07:36 PDT
> We should come back here and change this to be:
> 
>     typedef std::function<void (const PathElement&)> PathApplierFunction;
> 
> Cleaner to use std::function instead of void*.

Doing so via bug 147368