Bug 965022 - Avoid passing a TimeStamp to printf in PrintUniformityInfo. r=mchang
authorBotond Ballo <botond@mozilla.com>
Thu, 28 Aug 2014 16:32:49 -0400
changeset 223900 fe235a6881ca6510ea421b937f6fc3a8f427a0ab
parent 223899 7beceadb18b41f4ce05c3dba72f50b3889aca519
child 223901 a54e395d3945818d727ec20a48e8978af12af663
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchang
bugs965022
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 965022 - Avoid passing a TimeStamp to printf in PrintUniformityInfo. r=mchang
gfx/layers/composite/ContainerLayerComposite.cpp
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -110,29 +110,32 @@ static void DrawLayerInfo(const RenderTa
   nsIntPoint topLeft = visibleRegion.GetBounds().TopLeft();
   aManager->GetTextRenderer()->RenderText(ss.str().c_str(), gfx::IntPoint(topLeft.x, topLeft.y),
                                           aLayer->GetEffectiveTransform(), 16,
                                           maxWidth);
 }
 
 static void PrintUniformityInfo(Layer* aLayer)
 {
+  static TimeStamp t0 = TimeStamp::Now();
+
   // Don't want to print a log for smaller layers
   if (aLayer->GetEffectiveVisibleRegion().GetBounds().width < 300 ||
       aLayer->GetEffectiveVisibleRegion().GetBounds().height < 300) {
     return;
   }
 
   Matrix4x4 transform = aLayer->AsLayerComposite()->GetShadowTransform();
   if (!transform.Is2D()) {
     return;
   }
   Point translation = transform.As2D().GetTranslation();
   printf_stderr("UniformityInfo Layer_Move %llu %p %f, %f\n",
-            TimeStamp::Now(), aLayer, translation.x.value, translation.y.value);
+      (unsigned long long)(TimeStamp::Now() - t0).ToMilliseconds(), aLayer,
+      translation.x.value, translation.y.value);
 }
 
 /* all of the per-layer prepared data we need to maintain */
 struct PreparedLayer
 {
   PreparedLayer(LayerComposite *aLayer, RenderTargetIntRect aClipRect, bool aRestoreVisibleRegion, nsIntRegion &aVisibleRegion) :
     mLayer(aLayer), mClipRect(aClipRect), mRestoreVisibleRegion(aRestoreVisibleRegion), mSavedVisibleRegion(aVisibleRegion) {}
   LayerComposite* mLayer;