summaryrefslogtreecommitdiffstats
path: root/skia/include/corecg/SkUserConfig.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-12 20:08:50 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-12 20:08:50 +0000
commit2786f3db2489aa1fd2453fa85745e5c5658b1cd1 (patch)
tree905f82e544746d33d6cc4a3f760a345f648a4fd1 /skia/include/corecg/SkUserConfig.h
parentb734450b86e9d6bd7a07b381c119ca91803ae46b (diff)
downloadchromium_src-2786f3db2489aa1fd2453fa85745e5c5658b1cd1.zip
chromium_src-2786f3db2489aa1fd2453fa85745e5c5658b1cd1.tar.gz
chromium_src-2786f3db2489aa1fd2453fa85745e5c5658b1cd1.tar.bz2
Hook up skia's assertions to our logging system.
Review URL: http://codereview.chromium.org/17285 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/include/corecg/SkUserConfig.h')
-rw-r--r--skia/include/corecg/SkUserConfig.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/skia/include/corecg/SkUserConfig.h b/skia/include/corecg/SkUserConfig.h
index 2a646ce..28a1893 100644
--- a/skia/include/corecg/SkUserConfig.h
+++ b/skia/include/corecg/SkUserConfig.h
@@ -86,6 +86,14 @@
#define SK_SCALAR_IS_FLOAT
#undef SK_SCALAR_IS_FIXED
+// Log the file and line number for assertions.
+#define SkDebugf(...) SkDebugf_FileLine(__FILE__, __LINE__, __VA_ARGS__)
+void SkDebugf_FileLine(const char* file, int line, const char* format, ...);
+#include <stdio.h>
+#define SK_DEBUGBREAK(cond) do { if (!(cond)) { \
+ SkDebugf("%s:%d: failed assertion \"%s\"\n", \
+ __FILE__, __LINE__, #cond); SK_CRASH(); } } while (false)
+
#if defined(SK_BUILD_FOR_WIN32)
#define SK_BUILD_FOR_WIN
@@ -103,6 +111,10 @@ typedef unsigned uint32_t;
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 0
+// VC doesn't support __restrict__, so make it a NOP.
+#undef SK_RESTRICT
+#define SK_RESTRICT
+
// Skia uses this deprecated bzero function to fill zeros into a string.
#define bzero(str, len) memset(str, 0, len)
@@ -138,16 +150,14 @@ typedef unsigned uint32_t;
#endif
-// Don't use skia debug mode even when compiled as debug, because we don't
-// care about debugging this library, only our app.
-#undef SK_DEBUG
-#undef SK_SUPPORT_UNITTEST
-#define SK_RELEASE
-#undef SK_RESTRICT
-#define SK_RESTRICT
-#define SkDebugf(...) ((void)0)
+#ifndef NDEBUG
+ #define SK_DEBUG
+ #undef SK_RELEASE
+#else
+ #define SK_RELEASE
+ #undef SK_DEBUG
+#endif
// ===== End Chrome-specific definitions =====
#endif
-