aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-08-20 07:38:46 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-20 07:38:46 -0700
commit753b870c62bd22cee3d9a15efc634822724084ac (patch)
treeeac4b0e94cb975daa0ae5c5f49188aab797f58ab /experimental
parentb88813683cb1242ee5d0b6d8f5deb50b39e81e7f (diff)
Define NDEBUG instead of SK_DEBUG/SK_RELEASE.
This makes our builds more like Chrome's, and will make our builds fail if we accidentally use if SK_DEBUG instead of ifdef SK_DEBUG. BUG=skia: R=mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/481513004
Diffstat (limited to 'experimental')
-rw-r--r--experimental/Intersection/CubicIntersection_Test.cpp2
-rw-r--r--experimental/Intersection/CubicUtilities.cpp4
-rw-r--r--experimental/Intersection/CubicUtilities.h2
-rw-r--r--experimental/Intersection/DataTypes.cpp4
-rw-r--r--experimental/Intersection/DataTypes.h2
-rw-r--r--experimental/Intersection/Intersections.h10
-rw-r--r--experimental/Intersection/QuadraticImplicit.cpp6
-rw-r--r--experimental/Intersection/QuarticRoot.cpp2
8 files changed, 16 insertions, 16 deletions
diff --git a/experimental/Intersection/CubicIntersection_Test.cpp b/experimental/Intersection/CubicIntersection_Test.cpp
index ffaa933175..b43001bcb8 100644
--- a/experimental/Intersection/CubicIntersection_Test.cpp
+++ b/experimental/Intersection/CubicIntersection_Test.cpp
@@ -245,7 +245,7 @@ static void oneOff(const Cubic& cubic1, const Cubic& cubic2) {
intersections2.fPt[pt1].y, xy2.x, xy2.y, tt2);
#endif
SkASSERT(xy1.approximatelyEqual(xy2));
-#if SK_DEBUG
+#ifdef SK_DEBUG
found = false;
for (pt3 = 0; pt3 < intersections3.used(); ++pt3) {
if (roughly_equal(tt1, intersections3.fT[0][pt3])) {
diff --git a/experimental/Intersection/CubicUtilities.cpp b/experimental/Intersection/CubicUtilities.cpp
index c9881c1480..474dc5e526 100644
--- a/experimental/Intersection/CubicUtilities.cpp
+++ b/experimental/Intersection/CubicUtilities.cpp
@@ -20,7 +20,7 @@ double calcPrecision(const Cubic& cubic) {
return (width > height ? width : height) / gPrecisionUnit;
}
-#if SK_DEBUG
+#ifdef SK_DEBUG
double calcPrecision(const Cubic& cubic, double t, double scale) {
Cubic part;
sub_divide(cubic, SkTMax(0., t - scale), SkTMin(1., t + scale), part);
@@ -166,7 +166,7 @@ int cubicRootsValidT(double A, double B, double C, double D, double t[3]) {
}
int cubicRootsReal(double A, double B, double C, double D, double s[3]) {
-#if SK_DEBUG
+#ifdef SK_DEBUG
// create a string mathematica understands
// GDB set print repe 15 # if repeated digits is a bother
// set print elements 400 # if line doesn't fit
diff --git a/experimental/Intersection/CubicUtilities.h b/experimental/Intersection/CubicUtilities.h
index b0556191fd..eaf16a42c4 100644
--- a/experimental/Intersection/CubicUtilities.h
+++ b/experimental/Intersection/CubicUtilities.h
@@ -11,7 +11,7 @@
#include "SkTDArray.h"
double calcPrecision(const Cubic& cubic);
-#if SK_DEBUG
+#ifdef SK_DEBUG
double calcPrecision(const Cubic& cubic, double t, double scale);
#endif
void chop_at(const Cubic& src, CubicPair& dst, double t);
diff --git a/experimental/Intersection/DataTypes.cpp b/experimental/Intersection/DataTypes.cpp
index a4a3039cd5..3425ea9576 100644
--- a/experimental/Intersection/DataTypes.cpp
+++ b/experimental/Intersection/DataTypes.cpp
@@ -38,7 +38,7 @@ union Float_t
#endif
int32_t i;
float f;
-#if SK_DEBUG
+#ifdef SK_DEBUG
struct
{ // Bitfields for exploration. Do not use in production code.
uint32_t mantissa : 23;
@@ -76,7 +76,7 @@ int UlpsDiff(float A, float B)
}
#endif
-#if SK_DEBUG
+#ifdef SK_DEBUG
void mathematica_ize(char* str, size_t bufferLen) {
size_t len = strlen(str);
bool num = false;
diff --git a/experimental/Intersection/DataTypes.h b/experimental/Intersection/DataTypes.h
index 20dbef8751..870a6de765 100644
--- a/experimental/Intersection/DataTypes.h
+++ b/experimental/Intersection/DataTypes.h
@@ -409,7 +409,7 @@ struct QuadraticPair {
#define sk_double_isnan(a) sk_float_isnan(a)
// FIXME: move these to debugging file
-#if SK_DEBUG
+#ifdef SK_DEBUG
void mathematica_ize(char* str, size_t bufferSize);
bool valid_wind(int winding);
void winding_printf(int winding);
diff --git a/experimental/Intersection/Intersections.h b/experimental/Intersection/Intersections.h
index fc4c26c6e7..a4135af643 100644
--- a/experimental/Intersection/Intersections.h
+++ b/experimental/Intersection/Intersections.h
@@ -11,12 +11,12 @@ class Intersections {
public:
Intersections()
: fFlip(0)
-#if SK_DEBUG
+#ifdef SK_DEBUG
, fDepth(0)
#endif
, fSwap(0)
{
-#if SK_DEBUG
+#ifdef SK_DEBUG
bzero(fPt, sizeof(fPt));
bzero(fT, sizeof(fT));
bzero(fIsCoincident, sizeof(fIsCoincident));
@@ -35,7 +35,7 @@ public:
if (fIsCoincident[0] & (1 << index)) {
++count;
}
- #if SK_DEBUG
+ #ifdef SK_DEBUG
if (fIsCoincident[1] & (1 << index)) {
++count2;
}
@@ -119,7 +119,7 @@ public:
SkASSERT(++fDepth < 16);
}
-#if SK_DEBUG
+#ifdef SK_DEBUG
int depth() const {
return fDepth;
}
@@ -131,7 +131,7 @@ public:
unsigned char fUsed;
bool fFlip;
bool fUnsortable;
-#if SK_DEBUG
+#ifdef SK_DEBUG
int fDepth;
#endif
protected:
diff --git a/experimental/Intersection/QuadraticImplicit.cpp b/experimental/Intersection/QuadraticImplicit.cpp
index e2024f7bd7..f16ddd9370 100644
--- a/experimental/Intersection/QuadraticImplicit.cpp
+++ b/experimental/Intersection/QuadraticImplicit.cpp
@@ -13,7 +13,7 @@
#include "QuadraticUtilities.h"
#include "TSearch.h"
-#if SK_DEBUG
+#ifdef SK_DEBUG
#include "LineUtilities.h"
#endif
@@ -166,7 +166,7 @@ static bool isLinearInner(const Quadratic& q1, double t1s, double t1e, const Qua
int roots = intersect(q2, *testLines[index], rootTs);
for (int idx2 = 0; idx2 < roots; ++idx2) {
double t = rootTs.fT[0][idx2];
-#if SK_DEBUG
+#ifdef SK_DEBUG
_Point qPt, lPt;
xy_at_t(q2, t, qPt.x, qPt.y);
xy_at_t(*testLines[index], rootTs.fT[1][idx2], lPt.x, lPt.y);
@@ -261,7 +261,7 @@ static bool isLinear(const Quadratic& q1, const Quadratic& q2, Intersections& i)
static void relaxedIsLinear(const Quadratic& q1, const Quadratic& q2, Intersections& i) {
double m1 = flatMeasure(q1);
double m2 = flatMeasure(q2);
-#if SK_DEBUG
+#ifdef SK_DEBUG
double min = SkTMin(m1, m2);
if (min > 5) {
SkDebugf("%s maybe not flat enough.. %1.9g\n", __FUNCTION__, min);
diff --git a/experimental/Intersection/QuarticRoot.cpp b/experimental/Intersection/QuarticRoot.cpp
index 039a2c797f..46bb4f5024 100644
--- a/experimental/Intersection/QuarticRoot.cpp
+++ b/experimental/Intersection/QuarticRoot.cpp
@@ -32,7 +32,7 @@
int reducedQuarticRoots(const double t4, const double t3, const double t2, const double t1,
const double t0, const bool oneHint, double roots[4]) {
-#if SK_DEBUG
+#ifdef SK_DEBUG
// create a string mathematica understands
// GDB set print repe 15 # if repeated digits is a bother
// set print elements 400 # if line doesn't fit