[chromium] A couple early-outs for occlusion tracker
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2012 15:47:40 +0000 (15:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2012 15:47:40 +0000 (15:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80742

Patch by Dana Jansens <danakj@chromium.org> on 2012-03-12
Reviewed by Adrienne Walker.

Covered by existing tests.

* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::occluded):
(WebCore::::unoccludedContentRect):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp

index 4d2e395..25e292f 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-12  Dana Jansens  <danakj@chromium.org>
+
+        [chromium] A couple early-outs for occlusion tracker
+        https://bugs.webkit.org/show_bug.cgi?id=80742
+
+        Reviewed by Adrienne Walker.
+
+        Covered by existing tests.
+
+        * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+        (WebCore::::occluded):
+        (WebCore::::unoccludedContentRect):
+
 2012-03-12  Zeno Albisser  <zeno@webkit.org>
 
         [Qt][Mac] Build fails after adding WebCoreCFAutorelease(CFTypeRef) (r110360).
index f1c9338..9e49772 100644 (file)
@@ -243,6 +243,8 @@ bool CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerT
     ASSERT(!m_stack.isEmpty());
     if (m_stack.isEmpty())
         return false;
+    if (contentRect.isEmpty())
+        return true;
 
     ASSERT(layer->targetRenderSurface() == m_stack.last().surface);
 
@@ -284,6 +286,8 @@ IntRect CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::unoccludedContentR
     ASSERT(!m_stack.isEmpty());
     if (m_stack.isEmpty())
         return contentRect;
+    if (contentRect.isEmpty())
+        return contentRect;
 
     // We want to return a rect that contains all the visible parts of |contentRect| in both screen space and in the target surface.
     // So we find the visible parts of |contentRect| in each space, and take the intersection.