Title: [109777] trunk/Source
Revision
109777
Author
commit-qu...@webkit.org
Date
2012-03-05 11:47:25 -0800 (Mon, 05 Mar 2012)

Log Message

[chromium] Initialize CCOverdrawCounts struct to zero
https://bugs.webkit.org/show_bug.cgi?id=80204

Patch by James Robinson <jam...@chromium.org> on 2012-03-05
Reviewed by Adrienne Walker.

Source/WebCore:

CCOverdrawCounts is stack allocated but not explicitly initialized, so the values are garbage. This adds a c'tor
to zero out the fields, which is the desired behavior.  Bug was initially caught by valgrind, see
http://crbug.com/116475

* platform/graphics/chromium/cc/CCRenderPass.h:
(WebCore::CCOverdrawCounts::CCOverdrawCounts):

Source/WebKit/chromium:

Update test to use c'tor instead of {} struct initialization.

* tests/CCQuadCullerTest.cpp:
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109776 => 109777)


--- trunk/Source/WebCore/ChangeLog	2012-03-05 19:38:04 UTC (rev 109776)
+++ trunk/Source/WebCore/ChangeLog	2012-03-05 19:47:25 UTC (rev 109777)
@@ -1,3 +1,17 @@
+2012-03-05  James Robinson  <jam...@chromium.org>
+
+        [chromium] Initialize CCOverdrawCounts struct to zero
+        https://bugs.webkit.org/show_bug.cgi?id=80204
+
+        Reviewed by Adrienne Walker.
+
+        CCOverdrawCounts is stack allocated but not explicitly initialized, so the values are garbage. This adds a c'tor
+        to zero out the fields, which is the desired behavior.  Bug was initially caught by valgrind, see
+        http://crbug.com/116475
+
+        * platform/graphics/chromium/cc/CCRenderPass.h:
+        (WebCore::CCOverdrawCounts::CCOverdrawCounts):
+
 2012-03-05  Min Qin  <qin...@google.com>
 
         Add media control css for chromium on android

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h (109776 => 109777)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h	2012-03-05 19:38:04 UTC (rev 109776)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h	2012-03-05 19:47:25 UTC (rev 109777)
@@ -39,6 +39,12 @@
 typedef Vector<OwnPtr<CCDrawQuad> > CCQuadList;
 
 struct CCOverdrawCounts {
+    CCOverdrawCounts()
+       : m_pixelsDrawnOpaque(0)
+       , m_pixelsDrawnTransparent(0)
+       , m_pixelsCulled(0)
+    {
+    }
     // Count of pixels that are opaque (and thus occlude). Ideally this is no more
     // than wiewport width x height.
     float m_pixelsDrawnOpaque;

Modified: trunk/Source/WebKit/chromium/ChangeLog (109776 => 109777)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-03-05 19:38:04 UTC (rev 109776)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-03-05 19:47:25 UTC (rev 109777)
@@ -1,3 +1,15 @@
+2012-03-05  James Robinson  <jam...@chromium.org>
+
+        [chromium] Initialize CCOverdrawCounts struct to zero
+        https://bugs.webkit.org/show_bug.cgi?id=80204
+
+        Reviewed by Adrienne Walker.
+
+        Update test to use c'tor instead of {} struct initialization.
+
+        * tests/CCQuadCullerTest.cpp:
+        (WebCore):
+
 2012-03-05  Takashi Toyoshima  <toyos...@chromium.org>
 
         [Chromium] [WebSocket] use OVERRIDE in WebSocketImpl.h

Modified: trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp (109776 => 109777)


--- trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp	2012-03-05 19:38:04 UTC (rev 109776)
+++ trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp	2012-03-05 19:47:25 UTC (rev 109777)
@@ -64,7 +64,7 @@
 
 #define DECLARE_AND_INITIALIZE_TEST_QUADS               \
     CCQuadList quadList;                                \
-    CCOverdrawCounts overdraw = {0, 0, 0};              \
+    CCOverdrawCounts overdraw;              \
     TransformationMatrix childTransform;                \
     IntSize rootSize = IntSize(300, 300);               \
     IntRect rootRect = IntRect(IntPoint(), rootSize);   \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to