[CSS Shapes] Revise the ShapeInterval set operations' implementation
authorhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 15:43:30 +0000 (15:43 +0000)
committerhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2013 15:43:30 +0000 (15:43 +0000)
commit962c48bd1358514a6f2f790cb085aae3eac824b4
tree5b8da7efb33ab5c819c0d410306559a3f58241cb
parentb8439e2efdceaf5e91057316808d127bf035b9e3
[CSS Shapes] Revise the ShapeInterval set operations' implementation
https://bugs.webkit.org/show_bug.cgi?id=120349

Reviewed by Alexandru Chiculita.

Revised the ShapeIntervals unite, intersect, and subtract operations to
improve efficiency and clarity.

No new tests are required, this is just an internal refactoring.

* rendering/shapes/PolygonShape.cpp:
(WebCore::computeOverlappingEdgeXProjections): Removed call to ShapeInterval<T>sortVector(), since calling std::sort directly is simpler.
* rendering/shapes/ShapeInterval.h:
(WebCore::ShapeInterval::contains): True if the interval parameter is within this interval.
(WebCore::ShapeInterval::intersect): Substantially revised version of the original method.
(WebCore::ShapeInterval::uniteVectors): Ditto.
(WebCore::ShapeInterval::intersectVectors): Ditto.
(WebCore::ShapeInterval::subtractVectors): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/shapes/PolygonShape.cpp
Source/WebCore/rendering/shapes/ShapeInterval.h