Changeset 187621 in webkit


Ignore:
Timestamp:
Jul 30, 2015 4:41:54 PM (9 years ago)
Author:
Simon Fraser
Message:

Make Path::apply() take a function reference
https://bugs.webkit.org/show_bug.cgi?id=147472

Reviewed by Anders Carlsson.

Path::apply() should take a const reference to a std::function.

  • platform/graphics/Path.h:
  • platform/graphics/cairo/PathCairo.cpp:
  • platform/graphics/cg/PathCG.cpp:

(WebCore::CGPathApplierToPathApplier):
(WebCore::Path::apply):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r187620 r187621  
     12015-07-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make Path::apply() take a function reference
     4        https://bugs.webkit.org/show_bug.cgi?id=147472
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Path::apply() should take a const reference to a std::function.
     9
     10        * platform/graphics/Path.h:
     11        * platform/graphics/cairo/PathCairo.cpp:
     12        * platform/graphics/cg/PathCG.cpp:
     13        (WebCore::CGPathApplierToPathApplier):
     14        (WebCore::Path::apply):
     15
    1162015-07-30  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/Path.h

    r187597 r187621  
    156156        WEBCORE_EXPORT PlatformPathPtr ensurePlatformPath();
    157157
    158         WEBCORE_EXPORT void apply(PathApplierFunction) const;
     158        WEBCORE_EXPORT void apply(const PathApplierFunction&) const;
    159159        void transform(const AffineTransform&);
    160160
  • trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp

    r187597 r187621  
    391391}
    392392
    393 void Path::apply(PathApplierFunction function) const
     393void Path::apply(const PathApplierFunction& function) const
    394394{
    395395    if (isNull())
  • trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp

    r187597 r187621  
    376376}
    377377
    378 static void CGPathApplierToPathApplier(void *info, const CGPathElement* element)
    379 {
    380     PathApplierFunction function = *(PathApplierFunction*)info;
     378static void CGPathApplierToPathApplier(void* info, const CGPathElement* element)
     379{
     380    const PathApplierFunction& function = *(PathApplierFunction*)info;
    381381    FloatPoint points[3];
    382382    PathElement pelement;
     
    404404}
    405405
    406 void Path::apply(PathApplierFunction function) const
    407 {
    408     if (isNull())
    409         return;
    410 
    411     CGPathApply(m_path, &function, CGPathApplierToPathApplier);
     406void Path::apply(const PathApplierFunction& function) const
     407{
     408    if (isNull())
     409        return;
     410
     411    CGPathApply(m_path, (void*)&function, CGPathApplierToPathApplier);
    412412}
    413413
Note: See TracChangeset for help on using the changeset viewer.