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
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 507507b..fedc9ea 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -615,7 +615,7 @@
             SkCanvas* canvas = targets[j]->surface.get() ? targets[j]->surface->getCanvas() : NULL;
             const char* config = targets[j]->config.name;
 
-#if SK_DEBUG
+#ifdef SK_DEBUG
             // skia:2797  Some SKPs SkASSERT in debug mode.  Skip them for now.
             if (0 == strcmp("565", config) && SkStrContains(bench->getName(), ".skp")) {
                 SkDebugf("Skipping 565 %s.  See skia:2797\n", bench->getName());
diff --git a/experimental/Intersection/CubicIntersection_Test.cpp b/experimental/Intersection/CubicIntersection_Test.cpp
index ffaa933..b43001b 100644
--- a/experimental/Intersection/CubicIntersection_Test.cpp
+++ b/experimental/Intersection/CubicIntersection_Test.cpp
@@ -245,7 +245,7 @@
                 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 c9881c1..474dc5e 100644
--- a/experimental/Intersection/CubicUtilities.cpp
+++ b/experimental/Intersection/CubicUtilities.cpp
@@ -20,7 +20,7 @@
     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 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 b055619..eaf16a4 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 a4a3039..3425ea9 100644
--- a/experimental/Intersection/DataTypes.cpp
+++ b/experimental/Intersection/DataTypes.cpp
@@ -38,7 +38,7 @@
 #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 @@
 }
 #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 20dbef8..870a6de 100644
--- a/experimental/Intersection/DataTypes.h
+++ b/experimental/Intersection/DataTypes.h
@@ -409,7 +409,7 @@
 #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 fc4c26c..a4135af 100644
--- a/experimental/Intersection/Intersections.h
+++ b/experimental/Intersection/Intersections.h
@@ -11,12 +11,12 @@
 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 @@
             if (fIsCoincident[0] & (1 << index)) {
                 ++count;
             }
-    #if SK_DEBUG
+    #ifdef SK_DEBUG
             if (fIsCoincident[1] & (1 << index)) {
                 ++count2;
             }
@@ -119,7 +119,7 @@
         SkASSERT(++fDepth < 16);
     }
 
-#if SK_DEBUG
+#ifdef SK_DEBUG
     int depth() const {
         return fDepth;
     }
@@ -131,7 +131,7 @@
     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 e2024f7..f16ddd9 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 @@
         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 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 039a2c7..46bb4f5 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
diff --git a/gyp/common.gypi b/gyp/common.gypi
index 14a5419..2d3fddd 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -92,22 +92,11 @@
         # one makefile and allow someone to add SK_DEBUG etc for their own
         # debugging purposes.
         'configurations': {
-          'Debug': {
-            'defines': [
-              'SK_DEBUG',
-              'SK_DEVELOPER=1',
-            ],
-          },
-          'Release': {
-            'defines': [
-              'SK_RELEASE',
-            ],
-          },
+          'Debug':   { 'defines': [ 'SK_DEVELOPER=1' ] },
+          'Release': { 'defines': [ 'NDEBUG' ] },
           'Release_Developer': {
             'inherit_from': ['Release'],
-            'defines': [
-              'SK_DEVELOPER=1',
-            ],
+            'defines': [ 'SK_DEVELOPER=1' ],
           },
         },
       }],