<!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>[127756] 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/127756">127756</a></dd>
<dt>Author</dt> <dd>danakj@chromium.org</dd>
<dt>Date</dt> <dd>2012-09-06 10:29:05 -0700 (Thu, 06 Sep 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>[chromium] Add a customized copy() method to CCRenderPassDrawQuad
https://bugs.webkit.org/show_bug.cgi?id=95871

Reviewed by Adrienne Walker.

Source/WebCore:

CCRenderPassDrawQuad is special because a copied quad will need to
point to a different RenderPass id, since new ids are given to copied
RenderPasses. Add a custom copy() method to CCRenderPassDrawQuad that
takes as input the new RenderPass id that should appear in the copied
quad.

Test: CCDrawQuad.copyRenderPassDrawQuad

* platform/graphics/chromium/cc/CCDrawQuad.cpp:
(WebCore::CCDrawQuad::copy):
* platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:
(WebCore::CCRenderPassDrawQuad::copy):
(WebCore):
* platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:
(CCRenderPassDrawQuad):

Source/WebKit/chromium:

* tests/CCDrawQuadTest.cpp:
(WebCore):
(WebCore::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCDrawQuadcpp">trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCRenderPassDrawQuadcpp">trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCRenderPassDrawQuadh">trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h</a></li>
<li><a href="#trunkSourceWebKitchromiumChangeLog">trunk/Source/WebKit/chromium/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitchromiumtestsCCDrawQuadTestcpp">trunk/Source/WebKit/chromium/tests/CCDrawQuadTest.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (127755 => 127756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2012-09-06 17:26:07 UTC (rev 127755)
+++ trunk/Source/WebCore/ChangeLog        2012-09-06 17:29:05 UTC (rev 127756)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2012-09-06  Dana Jansens  &lt;danakj@chromium.org&gt;
+
+        [chromium] Add a customized copy() method to CCRenderPassDrawQuad
+        https://bugs.webkit.org/show_bug.cgi?id=95871
+
+        Reviewed by Adrienne Walker.
+
+        CCRenderPassDrawQuad is special because a copied quad will need to
+        point to a different RenderPass id, since new ids are given to copied
+        RenderPasses. Add a custom copy() method to CCRenderPassDrawQuad that
+        takes as input the new RenderPass id that should appear in the copied
+        quad.
+
+        Test: CCDrawQuad.copyRenderPassDrawQuad
+
+        * platform/graphics/chromium/cc/CCDrawQuad.cpp:
+        (WebCore::CCDrawQuad::copy):
+        * platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:
+        (WebCore::CCRenderPassDrawQuad::copy):
+        (WebCore):
+        * platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:
+        (CCRenderPassDrawQuad):
+
</ins><span class="cx"> 2012-09-06  Nikhil Bhargava  &lt;nbhargava@google.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove extraneous includes (HTMLElement, SVGElement, GlyphBuffer, Clipboard)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCDrawQuadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp (127755 => 127756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp        2012-09-06 17:26:07 UTC (rev 127755)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCDrawQuad.cpp        2012-09-06 17:29:05 UTC (rev 127756)
</span><span class="lines">@@ -99,6 +99,9 @@
</span><span class="cx"> 
</span><span class="cx"> PassOwnPtr&lt;CCDrawQuad&gt; CCDrawQuad::copy(const CCSharedQuadState* copiedSharedQuadState) const
</span><span class="cx"> {
</span><ins>+    // RenderPass quads have their own copy() method.
+    ASSERT(material() != RenderPass);
+
</ins><span class="cx">     unsigned bytes = size();
</span><span class="cx">     ASSERT(bytes);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCRenderPassDrawQuadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp (127755 => 127756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp        2012-09-06 17:26:07 UTC (rev 127755)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp        2012-09-06 17:29:05 UTC (rev 127756)
</span><span class="lines">@@ -54,4 +54,17 @@
</span><span class="cx">     return static_cast&lt;const CCRenderPassDrawQuad*&gt;(quad);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassOwnPtr&lt;CCRenderPassDrawQuad&gt; CCRenderPassDrawQuad::copy(const CCSharedQuadState* copiedSharedQuadState, int copiedRenderPassId) const
+{
+    unsigned bytes = size();
+    ASSERT(bytes);
+
+    OwnPtr&lt;CCRenderPassDrawQuad&gt; copyQuad(adoptPtr(reinterpret_cast&lt;CCRenderPassDrawQuad*&gt;(new char[bytes])));
+    memcpy(copyQuad.get(), this, bytes);
+    copyQuad-&gt;setSharedQuadState(copiedSharedQuadState);
+    copyQuad-&gt;m_renderPassId = copiedRenderPassId;
+
+    return copyQuad.release();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCRenderPassDrawQuadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h (127755 => 127756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h        2012-09-06 17:26:07 UTC (rev 127755)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPassDrawQuad.h        2012-09-06 17:29:05 UTC (rev 127756)
</span><span class="lines">@@ -51,6 +51,8 @@
</span><span class="cx">     float maskTexCoordOffsetX() const { return m_maskTexCoordOffsetX; }
</span><span class="cx">     float maskTexCoordOffsetY() const { return m_maskTexCoordOffsetY; }
</span><span class="cx"> 
</span><ins>+    PassOwnPtr&lt;CCRenderPassDrawQuad&gt; copy(const CCSharedQuadState* copiedSharedQuadState, int copiedRenderPassId) const;
+
</ins><span class="cx"> private:
</span><span class="cx">     CCRenderPassDrawQuad(const CCSharedQuadState*, const IntRect&amp;, int renderPassId, bool isReplica, CCResourceProvider::ResourceId maskResourceId, const IntRect&amp; contentsChangedSinceLastFrame, float maskTexCoordScaleX, float maskTexCoordScaleY, float maskTexCoordOffsetX, float maskTexCoordOffsetY);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitchromiumChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/chromium/ChangeLog (127755 => 127756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/chromium/ChangeLog        2012-09-06 17:26:07 UTC (rev 127755)
+++ trunk/Source/WebKit/chromium/ChangeLog        2012-09-06 17:29:05 UTC (rev 127756)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2012-09-06  Dana Jansens  &lt;danakj@chromium.org&gt;
+
+        [chromium] Add a customized copy() method to CCRenderPassDrawQuad
+        https://bugs.webkit.org/show_bug.cgi?id=95871
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCDrawQuadTest.cpp:
+        (WebCore):
+        (WebCore::TEST):
+
</ins><span class="cx"> 2012-09-06  Ilya Tikhonovsky  &lt;loislo@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed Web Inspector: test fix.
</span></span></pre></div>
<a id="trunkSourceWebKitchromiumtestsCCDrawQuadTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/chromium/tests/CCDrawQuadTest.cpp (127755 => 127756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/chromium/tests/CCDrawQuadTest.cpp        2012-09-06 17:26:07 UTC (rev 127755)
+++ trunk/Source/WebKit/chromium/tests/CCDrawQuadTest.cpp        2012-09-06 17:29:05 UTC (rev 127756)
</span><span class="lines">@@ -112,6 +112,12 @@
</span><span class="cx">     compareDrawQuad(quad.get(), copy.get(), copySharedState.get()); \
</span><span class="cx">     const Type* copyQuad = Type::materialCast(copy.get());
</span><span class="cx"> 
</span><ins>+#define SETUP_AND_COPY_QUAD_1(Type, quad, a) \
+    quad-&gt;setQuadVisibleRect(quadVisibleRect); \
+    OwnPtr&lt;CCDrawQuad&gt; copy(quad-&gt;copy(copySharedState.get(), a));    \
+    compareDrawQuad(quad.get(), copy.get(), copySharedState.get()); \
+    const Type* copyQuad = Type::materialCast(copy.get());
+
</ins><span class="cx"> #define CREATE_QUAD_0(Type) \
</span><span class="cx">     QUAD_DATA \
</span><span class="cx">     OwnPtr&lt;Type&gt; quad(Type::create(sharedState.get(), quadRect)); \
</span><span class="lines">@@ -158,6 +164,11 @@
</span><span class="cx">     OwnPtr&lt;Type&gt; quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h)); \
</span><span class="cx">     SETUP_AND_COPY_QUAD(Type, quad);
</span><span class="cx"> 
</span><ins>+#define CREATE_QUAD_8_1(Type, a, b, c, d, e, f, g, h, copyA) \
+    QUAD_DATA \
+    OwnPtr&lt;Type&gt; quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h)); \
+    SETUP_AND_COPY_QUAD_1(Type, quad, copyA);
+
</ins><span class="cx"> #define CREATE_QUAD_9(Type, a, b, c, d, e, f, g, h, i) \
</span><span class="cx">     QUAD_DATA \
</span><span class="cx">     OwnPtr&lt;Type&gt; quad(Type::create(sharedState.get(), quadRect, a, b, c, d, e, f, g, h, i)); \
</span><span class="lines">@@ -208,9 +219,11 @@
</span><span class="cx">     float maskTexCoordOffsetX = -45;
</span><span class="cx">     float maskTexCoordOffsetY = -21;
</span><span class="cx"> 
</span><ins>+    int copiedRenderPassId = 235;
+
</ins><span class="cx">     CREATE_SHARED_STATE();
</span><del>-    CREATE_QUAD_8(CCRenderPassDrawQuad, renderPassId, isReplica, maskResourceId, contentsChangedSinceLastFrame, maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY);
-    EXPECT_EQ(renderPassId, copyQuad-&gt;renderPassId());
</del><ins>+    CREATE_QUAD_8_1(CCRenderPassDrawQuad, renderPassId, isReplica, maskResourceId, contentsChangedSinceLastFrame, maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY, copiedRenderPassId);
+    EXPECT_EQ(copiedRenderPassId, copyQuad-&gt;renderPassId());
</ins><span class="cx">     EXPECT_EQ(isReplica, copyQuad-&gt;isReplica());
</span><span class="cx">     EXPECT_EQ(maskResourceId, copyQuad-&gt;maskResourceId());
</span><span class="cx">     EXPECT_RECT_EQ(contentsChangedSinceLastFrame, copyQuad-&gt;contentsChangedSinceLastFrame());
</span></span></pre>
</div>
</div>

</body>
</html>