Changeset 183088 in webkit


Ignore:
Timestamp:
Apr 21, 2015 5:38:04 PM (9 years ago)
Author:
jinwoo7.song@samsung.com
Message:

[Cairo] Implement Path::addPath
https://bugs.webkit.org/show_bug.cgi?id=130580

Reviewed by Dirk Schulze.

Source/WebCore:

Add support for addPath method for ports using cairo.
This patch is originally authored by Jae Hyun Park <jaepark@webkit.org>.

Test: fast/canvas/canvas-path-addPath.html

  • platform/graphics/cairo/PathCairo.cpp:

(WebCore::Path::addPath): Implement addPath for cairo.

LayoutTests:

Enable addPath testcase in EFL port.

  • platform/efl/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r183085 r183088  
     12015-04-21  Jinwoo Song  <jinwoo7.song@samsung.com>
     2
     3        [Cairo] Implement Path::addPath
     4        https://bugs.webkit.org/show_bug.cgi?id=130580
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Enable addPath testcase in EFL port.
     9
     10        * platform/efl/TestExpectations:
     11
    1122015-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
    213
  • trunk/LayoutTests/platform/efl/TestExpectations

    r183075 r183088  
    217217# Tests for features under development
    218218# ------------------------------------
    219 
    220 # Path::addPath needs to be implemented
    221 webkit.org/b/130464 fast/canvas/canvas-path-addPath.html
    222219
    223220# Unclassified failures
  • trunk/Source/WebCore/ChangeLog

    r183087 r183088  
     12015-04-21  Jinwoo Song  <jinwoo7.song@samsung.com>
     2
     3        [Cairo] Implement Path::addPath
     4        https://bugs.webkit.org/show_bug.cgi?id=130580
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Add support for addPath method for ports using cairo.
     9        This patch is originally authored by Jae Hyun Park <jaepark@webkit.org>.
     10
     11        Test: fast/canvas/canvas-path-addPath.html
     12
     13        * platform/graphics/cairo/PathCairo.cpp:
     14        (WebCore::Path::addPath): Implement addPath for cairo.
     15
    1162015-04-21  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp

    r180881 r183088  
    3232#include "FloatRect.h"
    3333#include "GraphicsContext.h"
    34 #include "NotImplemented.h"
    3534#include "OwnPtrCairo.h"
    3635#include "PlatformPathCairo.h"
     
    313312}
    314313
    315 void Path::addPath(const Path&, const AffineTransform&)
    316 {
    317     // FIXME: This should probably be very similar to Path::transform.
    318     notImplemented();
     314void Path::addPath(const Path& path, const AffineTransform& transform)
     315{
     316    if (path.isNull())
     317        return;
     318
     319    cairo_matrix_t matrix(transform);
     320    if (cairo_matrix_invert(&matrix) != CAIRO_STATUS_SUCCESS)
     321        return;
     322
     323    cairo_t* cr = path.platformPath()->context();
     324    cairo_save(cr);
     325    cairo_transform(cr, &matrix);
     326    std::unique_ptr<cairo_path_t, void(*)(cairo_path_t*)> pathCopy(cairo_copy_path(cr), [](cairo_path_t* path) {
     327        cairo_path_destroy(path);
     328    });
     329    cairo_restore(cr);
     330    cairo_append_path(ensurePlatformPath()->context(), pathCopy.get());
    319331}
    320332
Note: See TracChangeset for help on using the changeset viewer.