Early-out in Region::unite() for adding an empty region.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 02:58:54 +0000 (02:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 02:58:54 +0000 (02:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79174

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

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Region.cpp

index e877f52..f4d20f7 100644 (file)
@@ -1,5 +1,15 @@
 2012-02-21  Dana Jansens  <danakj@chromium.org>
 
+        Early-out in Region::unite() for adding an empty region.
+        https://bugs.webkit.org/show_bug.cgi?id=79174
+
+        Reviewed by Anders Carlsson.
+
+        * platform/graphics/Region.cpp:
+        (WebCore::Region::unite):
+
+2012-02-21  Dana Jansens  <danakj@chromium.org>
+
         [chromium] Painting a layer clears opaque rect in untouched tiles
         https://bugs.webkit.org/show_bug.cgi?id=79157
 
index 584a3a5..7895564 100644 (file)
@@ -443,6 +443,9 @@ void Region::intersect(const Region& region)
 
 void Region::unite(const Region& region)
 {
+    if (region.isEmpty())
+        return;
+
     Shape unitedShape = Shape::unionShapes(m_shape, region.m_shape);
 
     m_shape.swap(unitedShape);