Bug 1450346. Properly initialize mAppUnitsPerDevPixel. r=mstange draft
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 30 Mar 2018 16:24:13 -0400
changeset 775292 55eb3d576961d6ee0c6c458535bae65c5aeab705
parent 774965 b4278b2f0801917efce3826515817a7e1251b4ce
push id104686
push userbmo:jmuizelaar@mozilla.com
push dateFri, 30 Mar 2018 20:29:57 +0000
reviewersmstange
bugs1450346
milestone61.0a1
Bug 1450346. Properly initialize mAppUnitsPerDevPixel. r=mstange
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -284,16 +284,18 @@ struct DIGroup
   nsPoint mLastAnimatedGeometryRootOrigin;
   IntRect mInvalidRect;
   nsRect mGroupBounds;
   int32_t mAppUnitsPerDevPixel;
   gfx::Size mScale;
   IntPoint mGroupOffset;
   Maybe<wr::ImageKey> mKey;
 
+  DIGroup() : mAppUnitsPerDevPixel(0) {}
+
   void InvalidateRect(const IntRect& aRect)
   {
     // Empty rects get dropped
     mInvalidRect = mInvalidRect.Union(aRect);
   }
 
   IntRect ItemBounds(nsDisplayItem* aItem)
   {
@@ -1042,17 +1044,17 @@ WebRenderCommandBuilder::DoGroupingForDi
   auto q = groupBounds;
   gfx::Size scale = aSc.GetInheritedScale();
   GP("Inherrited scale %f %f\n", scale.width, scale.height);
   GP("Bounds: %d %d %d %d vs %d %d %d %d\n", p.x, p.y, p.width, p.height, q.x, q.y, q.width, q.height);
   if (!group.mGroupBounds.IsEqualEdges(groupBounds) ||
       group.mAppUnitsPerDevPixel != appUnitsPerDevPixel ||
       group.mScale != scale) {
     if (group.mAppUnitsPerDevPixel != appUnitsPerDevPixel) {
-      printf("app unit %d %d\n", group.mAppUnitsPerDevPixel, appUnitsPerDevPixel);
+      GP("app unit %d %d\n", group.mAppUnitsPerDevPixel, appUnitsPerDevPixel);
     }
     // The bounds have changed so we need to discard the old image and add all
     // the commands again.
     auto p = group.mGroupBounds;
     auto q = groupBounds;
     GP("Bounds change: %d %d %d %d vs %d %d %d %d\n", p.x, p.y, p.width, p.height, q.x, q.y, q.width, q.height);
 
     group.ClearItems();