Region::contains(IntPoint) is slow
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 22:35:16 +0000 (22:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 22:35:16 +0000 (22:35 +0000)
commit81a17247e4d11425352fb6cf414f284fbee2428b
treeab4faf8a7c030d8c164e69c4f2bfe6c2701ea75e
parentfd75cb1445b2bcce6ee6ec8b2a2ed0a5759fde77
Region::contains(IntPoint) is slow
https://bugs.webkit.org/show_bug.cgi?id=81008

Patch by Dana Jansens <danakj@chromium.org> on 2012-03-13
Reviewed by Anders Carlsson.

Source/WebCore:

Speed up Region::contains(IntPoint) by directly testing if the point
is inside the Region's shape, rather than using a temporary 1x1 Region
for the test.

Unit test: RegionTest.containsPoint

* platform/graphics/Region.cpp:
(WebCore::Region::contains):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/RegionTest.cpp: Added.
(WebCore):
(WebCore::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Region.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/RegionTest.cpp [new file with mode: 0644]