Title: [114383] trunk/Source/WebCore
Revision
114383
Author
[email protected]
Date
2012-04-17 08:50:20 -0700 (Tue, 17 Apr 2012)

Log Message

[chromium] Consistent checking for clipped rects when we need the computed result enclosed within the real result
https://bugs.webkit.org/show_bug.cgi?id=83543

Reviewed by Adrienne Walker.

It should not be possible to make a rect in layer space that is clipped
by the camera but for which the screen space transform gives a
rectilinear output. But use consistent methods for checking that the
result remains enclosed within the actual pixels.

One day when clipped is true, we can find an interior axis-aligned rect
within the clipped result, and checking clipped explicitly makes this
more clear.

Covered by existing tests.

* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::computeOcclusionBehindLayer):
(WebCore::::markOccludedBehindLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114382 => 114383)


--- trunk/Source/WebCore/ChangeLog	2012-04-17 15:38:40 UTC (rev 114382)
+++ trunk/Source/WebCore/ChangeLog	2012-04-17 15:50:20 UTC (rev 114383)
@@ -1,3 +1,25 @@
+2012-04-17  Dana Jansens  <[email protected]>
+
+        [chromium] Consistent checking for clipped rects when we need the computed result enclosed within the real result
+        https://bugs.webkit.org/show_bug.cgi?id=83543
+
+        Reviewed by Adrienne Walker.
+
+        It should not be possible to make a rect in layer space that is clipped
+        by the camera but for which the screen space transform gives a
+        rectilinear output. But use consistent methods for checking that the
+        result remains enclosed within the actual pixels.
+
+        One day when clipped is true, we can find an interior axis-aligned rect
+        within the clipped result, and checking clipped explicitly makes this
+        more clear.
+
+        Covered by existing tests.
+
+        * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+        (WebCore::computeOcclusionBehindLayer):
+        (WebCore::::markOccludedBehindLayer):
+
 2012-04-17  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Suggest box appears after the command was executed in console sometimes.

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp (114382 => 114383)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp	2012-04-17 15:38:40 UTC (rev 114382)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp	2012-04-17 15:50:20 UTC (rev 114383)
@@ -209,10 +209,9 @@
     ASSERT(layer->visibleLayerRect().contains(opaqueContents.bounds()));
 
     bool clipped;
-    FloatQuad unoccludedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visibleLayerRect()), clipped);
-    bool isPaintedAxisAligned = unoccludedQuad.isRectilinear();
+    FloatQuad visibleTransformedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visibleLayerRect()), clipped);
     // FIXME: Find a rect interior to each transformed quad.
-    if (clipped || !isPaintedAxisAligned)
+    if (clipped || !visibleTransformedQuad.isRectilinear())
         return Region();
 
     Region transformedOpaqueContents;
@@ -253,10 +252,12 @@
 
     if (layerTransformsToScreenKnown(layer)) {
         TransformationMatrix targetToScreenTransform = m_stack.last().surface->screenSpaceTransform();
-        FloatQuad scissorInScreenQuad = targetToScreenTransform.mapQuad(FloatQuad(FloatRect(scissorInTarget)));
-        if (!scissorInScreenQuad.isRectilinear())
+        bool clipped;
+        FloatQuad scissorInScreenQuad = CCMathUtil::mapQuad(targetToScreenTransform, FloatQuad(FloatRect(scissorInTarget)), clipped);
+        // FIXME: Find a rect interior to the transformed scissor quad.
+        if (clipped || !scissorInScreenQuad.isRectilinear())
             return;
-        IntRect scissorInScreenRect = intersection(m_scissorRectInScreenSpace, enclosedIntRect(CCMathUtil::mapClippedRect(targetToScreenTransform, FloatRect(scissorInTarget))));
+        IntRect scissorInScreenRect = intersection(m_scissorRectInScreenSpace, enclosedIntRect(scissorInScreenQuad.boundingBox()));
         m_stack.last().occlusionInScreen.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToScreenSpaceTransform<LayerType>(layer), opaqueContents, scissorInScreenRect, m_usePaintTracking));
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to