Back out 87e39d7d851a (bug 984796) for printfing like log size is infinite
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 21 Mar 2014 19:49:15 -0700
changeset 174901 91e63f57c896b0bcc969911f0010b0f1cec14564
parent 174900 cdfc29502d3ac7cf975501a4c7d5e8c4fff9a3c7
child 174902 0b9450153e8e5718d7cec117db8a2fcdfe820ab7
push id26467
push userphilringnalda@gmail.com
push dateSun, 23 Mar 2014 00:31:32 +0000
treeherdermozilla-central@2f5fff1478a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs984796
milestone31.0a1
backs out87e39d7d851a17756c396a4d2ad69c186b472a61
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
Back out 87e39d7d851a (bug 984796) for printfing like log size is infinite CLOSED TREE
gfx/2d/Path.cpp
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/composite/LayerManagerComposite.cpp
--- a/gfx/2d/Path.cpp
+++ b/gfx/2d/Path.cpp
@@ -5,25 +5,16 @@
 
 #include "2D.h"
 #include "PathAnalysis.h"
 #include "PathHelpers.h"
 
 namespace mozilla {
 namespace gfx {
 
-static float CubicRoot(float aValue) {
-  if (aValue < 0.0) {
-    return -CubicRoot(-aValue);
-  }
-  else {
-    return powf(aValue, 1.0f / 3.0f);
-  }
-}
-
 struct BezierControlPoints
 {
   BezierControlPoints() {}
   BezierControlPoints(const Point &aCP1, const Point &aCP2,
                       const Point &aCP3, const Point &aCP4)
     : mCP1(aCP1), mCP2(aCP2), mCP3(aCP3), mCP4(aCP4)
   {
   }
@@ -273,33 +264,33 @@ FindInflectionApproximationRange(BezierC
 {
     SplitBezier(aControlPoints, nullptr, &aControlPoints, aT);
 
     Point cp21 = aControlPoints.mCP2 - aControlPoints.mCP1;
     Point cp41 = aControlPoints.mCP4 - aControlPoints.mCP1;
 
     if (cp21.x == 0 && cp21.y == 0) {
       // In this case s3 becomes lim[n->0] (cp41.x * n) / n - (cp41.y * n) / n = cp41.x - cp41.y.
-      *aMin = aT - CubicRoot(double(aTolerance / (cp41.x - cp41.y)));
-      *aMax = aT + CubicRoot(aTolerance / (cp41.x - cp41.y));
+      *aMin = aT - pow(aTolerance / (cp41.x - cp41.y), Float(1. / 3.));
+      *aMax = aT + pow(aTolerance / (cp41.x - cp41.y), Float(1. / 3.));;
       return;
     }
 
     Float s3 = (cp41.x * cp21.y - cp41.y * cp21.x) / hypotf(cp21.x, cp21.y);
 
     if (s3 == 0) {
       // This means within the precision we have it can be approximated
       // infinitely by a linear segment. Deal with this by specifying the
       // approximation range as extending beyond the entire curve.
       *aMin = -1.0f;
       *aMax = 2.0f;
       return;
     }
 
-    Float tf = CubicRoot(abs(aTolerance / s3));
+    Float tf = pow(abs(aTolerance / s3), Float(1. / 3.));
 
     *aMin = aT - tf * (1 - aT);
     *aMax = aT + tf * (1 - aT);
 }
 
 /* Find the inflection points of a bezier curve. Will return false if the
  * curve is degenerate in such a way that it is best approximated by a straight
  * line.
@@ -449,17 +440,17 @@ FlattenBezier(const BezierControlPoints 
   // segments.
   if (t1min > 0) {
     // Flatten the Bezier up until the first inflection point's approximation
     // point.
     SplitBezier(aControlPoints, &prevCPs,
                 &remainingCP, t1min);
     FlattenBezierCurveSegment(prevCPs, aSink, aTolerance);
   }
-  if (t1max >= 0 && t1max < 1.0 && (count == 1 || t2min > t1max)) {
+  if (t1max < 1.0 && (count == 1 || t2min > t1max)) {
     // The second inflection point's approximation range begins after the end
     // of the first, approximate the first inflection point by a line and
     // subsequently flatten up until the end or the next inflection point.
     SplitBezier(aControlPoints, nullptr, &nextCPs, t1max);
 
     aSink->LineTo(nextCPs.mCP1);
 
     if (count == 1 || (count > 1 && t2min >= 1.0)) {
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -208,45 +208,32 @@ ClientLayerManager::EndTransactionIntern
 void
 ClientLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
                                    void* aCallbackData,
                                    EndTransactionFlags aFlags)
 {
   if (mWidget) {
     mWidget->PrepareWindowEffects();
   }
-
-  printf_stderr("XXX - Bas - Wanting to draw client side!");
-
-  FlushRendering();
-
-  printf_stderr("XXX - Bas - Starting to draw client side!");
-
   EndTransactionInternal(aCallback, aCallbackData, aFlags);
-
-  printf_stderr("XXX - Bas - Finished validation!");
-
   ForwardTransaction(!(aFlags & END_NO_REMOTE_COMPOSITE));
 
   if (mRepeatTransaction) {
-    printf_stderr("XXX - Bas - Repeating transaction!");
     mRepeatTransaction = false;
     mIsRepeatTransaction = true;
     BeginTransaction();
     ClientLayerManager::EndTransaction(aCallback, aCallbackData, aFlags);
     mIsRepeatTransaction = false;
   } else {
     MakeSnapshotIfRequired();
   }
 
   for (size_t i = 0; i < mTexturePools.Length(); i++) {
     mTexturePools[i]->ReturnDeferredClients();
   }
-
-  printf_stderr("XXX - Bas - Finished drawing client side!");
 }
 
 bool
 ClientLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags)
 {
   mInTransaction = false;
 
   if (!mRoot) {
@@ -420,18 +407,16 @@ ClientLayerManager::ForwardTransaction(b
 
     if (sent) {
       mNeedsComposite = false;
     }
   } else if (HasShadowManager()) {
     NS_WARNING("failed to forward Layers transaction");
   }
 
-  printf_stderr("XXX - Bas - Forwarded transaction!");
-
   mForwarder->RemoveTexturesIfNecessary();
   mPhase = PHASE_NONE;
 
   // this may result in Layers being deleted, which results in
   // PLayer::Send__delete__() and DeallocShmem()
   mKeepAlive.Clear();
 }
 
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -202,18 +202,16 @@ void
 LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
                                       void* aCallbackData,
                                       EndTransactionFlags aFlags)
 {
   NS_ASSERTION(mInTransaction, "Didn't call BeginTransaction?");
   NS_ASSERTION(!aCallback && !aCallbackData, "Not expecting callbacks here");
   mInTransaction = false;
 
-  printf_stderr("XXX - Bas - Starting to draw host side!");
-
   if (!mIsCompositorReady) {
     return;
   }
   mIsCompositorReady = false;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   MOZ_LAYERS_LOG(("  ----- (beginning paint)"));
   Log();
@@ -249,18 +247,16 @@ LayerManagerComposite::EndTransaction(Dr
 
   mCompositor->SetTargetContext(nullptr);
   mTarget = nullptr;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   Log();
   MOZ_LAYERS_LOG(("]----- EndTransaction"));
 #endif
-
-  printf_stderr("XXX - Bas - Finished compositing host side!");
 }
 
 already_AddRefed<gfxASurface>
 LayerManagerComposite::CreateOptimalMaskSurface(const IntSize &aSize)
 {
   NS_RUNTIMEABORT("Should only be called on the drawing side");
   return nullptr;
 }