[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-changes
Subject:    [webkit-changes] [124270] trunk/Source
From:       shawnsingh () chromium ! org
Date:       2012-07-31 23:38:39
Message-ID: 20120731233841.54B684A1645 () svn ! webkit ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[124270] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt;  } #msg dl a { font-weight: \
bold} #msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
 #patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
                .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://trac.webkit.org/projects/webkit/changeset/124270">124270</a></dd> \
<dt>Author</dt> <dd>shawnsingh@chromium.org</dd> <dt>Date</dt> <dd>2012-07-31 \
16:38:39 -0700 (Tue, 31 Jul 2012)</dd> </dl>

<h3>Log Message</h3>
<pre>[chromium] Hit test points are being clipped by layers that should not clip
https://bugs.webkit.org/show_bug.cgi?id=92786

Reviewed by James Robinson.

Source/WebCore:

On impl-side hit testing for chromium compositor, we are
accidentally checking all ancestor layers for clipping, instead of
only layers that actually clip something. This patch fixes it.

Added new unit test that reproduces the scenario:
  CCLayerTreeHostCommonTest.verifyHitTestingForNonClippingIntermediateLayer

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::pointIsClippedBySurfaceOrClipRect):

Source/WebKit/chromium:

* tests/CCLayerTreeHostCommonTest.cpp: adds a test where the
  hit-testable layer does not overlap its parent. The parent does
  not clip, so the layer should still be hittable.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostCommoncpp">tr \
unk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp</a></li> \
<li><a href="#trunkSourceWebKitchromiumChangeLog">trunk/Source/WebKit/chromium/ChangeLog</a></li>
 <li><a href="#trunkSourceWebKitchromiumtestsCCLayerTreeHostCommonTestcpp">trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (124269 => \
124270)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog	2012-07-31 23:31:09 UTC (rev \
                124269)
+++ trunk/Source/WebCore/ChangeLog	2012-07-31 23:38:39 UTC (rev 124270)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2012-07-31  Shawn Singh  &lt;shawnsingh@chromium.org&gt;
+
+        [chromium] Hit test points are being clipped by layers that should not clip
+        https://bugs.webkit.org/show_bug.cgi?id=92786
+
+        Reviewed by James Robinson.
+
+        On impl-side hit testing for chromium compositor, we are
+        accidentally checking all ancestor layers for clipping, instead of
+        only layers that actually clip something. This patch fixes it.
+
+        Added new unit test that reproduces the scenario:
+          CCLayerTreeHostCommonTest.verifyHitTestingForNonClippingIntermediateLayer
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+        (WebCore::pointIsClippedBySurfaceOrClipRect):
+
</ins><span class="cx"> 2012-07-31  James Robinson  &lt;jamesr@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [chromium] REGRESSION(r123644) Compositor HUD \
crashes immediately with --show-paint-rects </span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostCommoncpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp (124269 \
=> 124270)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2012-07-31 \
                23:31:09 UTC (rev 124269)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2012-07-31 \
23:38:39 UTC (rev 124270) </span><span class="lines">@@ -918,7 +918,7 @@
</span><span class="cx">         // Note that drawableContentRects are actually in \
targetSurface space, so the transform we </span><span class="cx">         // have to \
provide is the target surface's screenSpaceTransform. </span><span class="cx">        \
CCLayerImpl* renderTarget = currentLayer-&gt;renderTarget(); </span><del>-        if \
(!pointHitsRect(viewportPoint, \
renderTarget-&gt;renderSurface()-&gt;screenSpaceTransform(), \
currentLayer-&gt;drawableContentRect())) </del><ins>+        if \
(layerClipsSubtree(currentLayer) &amp;&amp; !pointHitsRect(viewportPoint, \
renderTarget-&gt;renderSurface()-&gt;screenSpaceTransform(), \
currentLayer-&gt;drawableContentRect())) </ins><span class="cx">             return \
true; </span><span class="cx"> 
</span><span class="cx">         currentLayer = currentLayer-&gt;parent();
</span></span></pre></div>
<a id="trunkSourceWebKitchromiumChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/chromium/ChangeLog (124269 => \
124270)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/chromium/ChangeLog	2012-07-31 23:31:09 UTC \
                (rev 124269)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-07-31 23:38:39 UTC (rev 124270)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2012-07-31  Shawn Singh  &lt;shawnsingh@chromium.org&gt;
+
+        [chromium] Hit test points are being clipped by layers that should not clip
+        https://bugs.webkit.org/show_bug.cgi?id=92786
+
+        Reviewed by James Robinson.
+
+        * tests/CCLayerTreeHostCommonTest.cpp: adds a test where the
+          hit-testable layer does not overlap its parent. The parent does
+          not clip, so the layer should still be hittable.
+
</ins><span class="cx"> 2012-07-31  Chris Rogers  &lt;crogers@google.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Allow AudioDestination to support local/live audio \
input </span></span></pre></div>
<a id="trunkSourceWebKitchromiumtestsCCLayerTreeHostCommonTestcpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp (124269 => \
124270)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp	2012-07-31 23:31:09 \
                UTC (rev 124269)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp	2012-07-31 \
23:38:39 UTC (rev 124270) </span><span class="lines">@@ -3039,6 +3039,70 @@
</span><span class="cx">     EXPECT_EQ(2468, resultLayer-&gt;id());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST(CCLayerTreeHostCommonTest, \
verifyHitTestingForNonClippingIntermediateLayer) +{
+    // This test checks that hit testing code does not accidentally clip to layer
+    // bounds for a layer that actually does not clip.
+    DebugScopedSetImplThread thisScopeIsOnImplThread;
+
+    WebTransformationMatrix identityMatrix;
+    FloatPoint anchor(0, 0);
+
+    OwnPtr&lt;CCLayerImpl&gt; root = CCLayerImpl::create(1);
+    setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, \
FloatPoint(0, 0), IntSize(100, 100), false); +
+    {
+        OwnPtr&lt;CCLayerImpl&gt; intermediateLayer = CCLayerImpl::create(123);
+        FloatPoint position(10, 10); // this layer is positioned, and hit testing \
should correctly know where the layer is located. +        IntSize bounds(50, 50);
+        setLayerPropertiesForTesting(intermediateLayer.get(), identityMatrix, \
identityMatrix, anchor, position, bounds, false); +        // Sanity check the \
intermediate layer should not clip. +        \
ASSERT_FALSE(intermediateLayer-&gt;masksToBounds()); +        \
ASSERT_FALSE(intermediateLayer-&gt;maskLayer()); +
+        // The child of the intermediateLayer is translated so that it does not \
overlap intermediateLayer at all. +        // If child is incorrectly clipped, we \
would not be able to hit it successfully. +        OwnPtr&lt;CCLayerImpl&gt; child = \
CCLayerImpl::create(456); +        position = FloatPoint(60, 60); // 70, 70 in screen \
space +        bounds = IntSize(20, 20);
+        setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, \
anchor, position, bounds, false); +        child-&gt;setDrawsContent(true);
+        intermediateLayer-&gt;addChild(child.release());
+        root-&gt;addChild(intermediateLayer.release());
+    }
+
+    Vector&lt;CCLayerImpl*&gt; renderSurfaceLayerList;
+    int dummyMaxTextureSize = 512;
+    CCLayerTreeHostCommon::calculateDrawTransforms(root.get(), root-&gt;bounds(), 1, \
0, dummyMaxTextureSize, renderSurfaceLayerList); +    \
CCLayerTreeHostCommon::calculateVisibleAndScissorRects(renderSurfaceLayerList, \
FloatRect()); // empty scissorRect will help ensure we're hit testing the correct \
rect. +
+    // Sanity check the scenario we just created.
+    ASSERT_EQ(1u, renderSurfaceLayerList.size());
+    ASSERT_EQ(1u, root-&gt;renderSurface()-&gt;layerList().size());
+    ASSERT_EQ(456, root-&gt;renderSurface()-&gt;layerList()[0]-&gt;id());
+
+    // Hit testing for a point outside the layer should return a null pointer.
+    IntPoint testPoint(69, 69);
+    CCLayerImpl* resultLayer = \
CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, renderSurfaceLayerList); \
+    EXPECT_FALSE(resultLayer); +
+    testPoint = IntPoint(91, 91);
+    resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, \
renderSurfaceLayerList); +    EXPECT_FALSE(resultLayer);
+
+    // Hit testing for a point inside should return the child layer.
+    testPoint = IntPoint(71, 71);
+    resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, \
renderSurfaceLayerList); +    ASSERT_TRUE(resultLayer);
+    EXPECT_EQ(456, resultLayer-&gt;id());
+
+    testPoint = IntPoint(89, 89);
+    resultLayer = CCLayerTreeHostCommon::findLayerThatIsHitByPoint(testPoint, \
renderSurfaceLayerList); +    ASSERT_TRUE(resultLayer);
+    EXPECT_EQ(456, resultLayer-&gt;id());
+}
+
+
</ins><span class="cx"> TEST(CCLayerTreeHostCommonTest, \
verifyHitTestingForMultipleLayers) </span><span class="cx"> {
</span><span class="cx">     DebugScopedSetImplThread thisScopeIsOnImplThread;
</span></span></pre>
</div>
</div>

</body>
</html>



_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic