Coordinated Graphics: crash in TiledBackingStore::adjustForContentsRect
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2013 00:54:34 +0000 (00:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2013 00:54:34 +0000 (00:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107639

Patch by Seulgi Kim <seulgikim@company100.net> on 2013-02-04
Reviewed by Kenneth Rohde Christiansen.

In TiledBackingStore::adjustForContentsRect method, inflating is not
needed when there is no intersections between the cover/keep rect and
the content rect.

No new tests, no change in functionality.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::adjustForContentsRect):

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

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

index 66d2cc1354fbf1f5a9b0d8a68b96bbf088f9420d..cfff889fe069a8fab925b3b3694f1f6982c3d51e 100644 (file)
@@ -1,3 +1,19 @@
+2013-02-04  Seulgi Kim  <seulgikim@company100.net>
+
+        Coordinated Graphics: crash in TiledBackingStore::adjustForContentsRect
+        https://bugs.webkit.org/show_bug.cgi?id=107639
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        In TiledBackingStore::adjustForContentsRect method, inflating is not
+        needed when there is no intersections between the cover/keep rect and
+        the content rect.
+
+        No new tests, no change in functionality.
+
+        * platform/graphics/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::adjustForContentsRect):
+
 2013-02-04  Stephen White  <senorblanco@chromium.org>
 
         [skia] Remove use of SkSingleInputImageFilter.
index 2c430e4627922802803dd68a9e4f46805c8717a6..d902adb43e3b0d4c1ed314ba2c5ba1e85b2a5388 100644 (file)
@@ -362,6 +362,25 @@ void TiledBackingStore::adjustForContentsRect(IntRect& rect) const
     if (rect.size() == candidateSize)
         return;
 
+    /*
+     * In the following case, there is no intersection of the contents rect and the cover/keep rect.
+     * Thus the latter should not be inflated.
+     *
+     *  +---------------+
+     *  |   m_rect      |
+     *  +---------------+
+     *
+     *          +-------------------------------+
+     *          |      cover or keep rect       |
+     *          |         +---------+           |
+     *          |         | visible |           |
+     *          |         |  rect   |           |
+     *          |         +---------+           |
+     *          +-------------------------------+
+     */
+    if (rect.isEmpty())
+        return;
+
     // Even now we might cover more than the content area so let's inflate in the
     // opposite directions.
     int pixelsCovered = candidateSize.width() * candidateSize.height();