Changeset 87099 in webkit


Ignore:
Timestamp:
May 23, 2011 2:50:03 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-23 Mike Reed <reed@google.com>

Reviewed by James Robinson.

Skia: Need to implement GraphicsContext::clipConvexPolygon()
https://bugs.webkit.org/show_bug.cgi?id=41311

No new tests.

  • platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::setPathFromConvexPoints): (WebCore::GraphicsContext::drawConvexPolygon): (WebCore::GraphicsContext::clipConvexPolygon):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87098 r87099  
     12011-05-23  Mike Reed  <reed@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        Skia: Need to implement GraphicsContext::clipConvexPolygon()
     6        https://bugs.webkit.org/show_bug.cgi?id=41311
     7
     8        No new tests.
     9
     10        * platform/graphics/skia/GraphicsContextSkia.cpp:
     11        (WebCore::setPathFromConvexPoints):
     12        (WebCore::GraphicsContext::drawConvexPolygon):
     13        (WebCore::GraphicsContext::clipConvexPolygon):
     14
    1152011-05-23  James Simonsen  <simonjam@chromium.org>
    216
  • trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r85350 r87099  
    450450}
    451451
     452static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatPoint* points)
     453{
     454    path->incReserve(numPoints);
     455    path->moveTo(WebCoreFloatToSkScalar(points[0].x()),
     456                 WebCoreFloatToSkScalar(points[0].y()));
     457    for (size_t i = 1; i < numPoints; ++i) {
     458        path->lineTo(WebCoreFloatToSkScalar(points[i].x()),
     459                     WebCoreFloatToSkScalar(points[i].y()));
     460    }
     461    path->setIsConvex(true);
     462}
     463
    452464void GraphicsContext::drawConvexPolygon(size_t numPoints,
    453465                                        const FloatPoint* points,
     
    463475
    464476    SkPath path;
    465 
    466     path.incReserve(numPoints);
    467     path.moveTo(WebCoreFloatToSkScalar(points[0].x()),
    468                 WebCoreFloatToSkScalar(points[0].y()));
    469     for (size_t i = 1; i < numPoints; i++) {
    470         path.lineTo(WebCoreFloatToSkScalar(points[i].x()),
    471                     WebCoreFloatToSkScalar(points[i].y()));
    472     }
     477    setPathFromConvexPoints(&path, numPoints, points);
    473478
    474479    if (!isPathSkiaSafe(getCTM(), path))
     
    494499        return;
    495500
    496     // FIXME: IMPLEMENT!!
     501    SkPath path;
     502    setPathFromConvexPoints(&path, numPoints, points);
     503    platformContext()->canvas()->clipPath(path);
    497504}
    498505
Note: See TracChangeset for help on using the changeset viewer.