Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: include/core/SkPostConfig.h

Issue 340523007: CrashHandler for Windows. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: if elif Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/crash_handler.gyp ('k') | tools/CrashHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPostConfig_DEFINED 8 #ifndef SkPostConfig_DEFINED
9 #define SkPostConfig_DEFINED 9 #define SkPostConfig_DEFINED
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 # define SkNEW(type_name) (new type_name) 100 # define SkNEW(type_name) (new type_name)
101 # define SkNEW_ARGS(type_name, args) (new type_name args) 101 # define SkNEW_ARGS(type_name, args) (new type_name args)
102 # define SkNEW_ARRAY(type_name, count) (new type_name[(count)]) 102 # define SkNEW_ARRAY(type_name, count) (new type_name[(count)])
103 # define SkNEW_PLACEMENT(buf, type_name) (new (buf) type_name) 103 # define SkNEW_PLACEMENT(buf, type_name) (new (buf) type_name)
104 # define SkNEW_PLACEMENT_ARGS(buf, type_name, args) (new (buf) type_name args) 104 # define SkNEW_PLACEMENT_ARGS(buf, type_name, args) (new (buf) type_name args)
105 # define SkDELETE(obj) (delete (obj)) 105 # define SkDELETE(obj) (delete (obj))
106 # define SkDELETE_ARRAY(array) (delete[] (array)) 106 # define SkDELETE_ARRAY(array) (delete[] (array))
107 #endif 107 #endif
108 108
109 #ifndef SK_CRASH 109 #ifndef SK_CRASH
110 # if 1 // set to 0 for infinite loop, which can help connecting gdb 110 # ifdef SK_BUILD_FOR_WIN
111 # define SK_CRASH() do { SkNO_RETURN_HINT(); *(int *)(uintptr_t)0xbbadbeef = 0; } while (false) 111 # define SK_CRASH() __debugbreak()
112 # else 112 # else
113 # define SK_CRASH() do { SkNO_RETURN_HINT(); } while (true) 113 # if 1 // set to 0 for infinite loop, which can help connecting gdb
114 # define SK_CRASH() do { SkNO_RETURN_HINT(); *(int *)(uintptr_t)0xbbadbeef = 0; } while (false)
115 # else
116 # define SK_CRASH() do { SkNO_RETURN_HINT(); } while (true)
117 # endif
114 # endif 118 # endif
115 #endif 119 #endif
116 120
117 /////////////////////////////////////////////////////////////////////////////// 121 ///////////////////////////////////////////////////////////////////////////////
118 122
119 /** 123 /**
120 * SK_ENABLE_INST_COUNT controlls printing how many reference counted objects 124 * SK_ENABLE_INST_COUNT controlls printing how many reference counted objects
121 * are still held on exit. 125 * are still held on exit.
122 * Defaults to 1 in DEBUG and 0 in RELEASE. 126 * Defaults to 1 in DEBUG and 0 in RELEASE.
123 */ 127 */
(...skipping 23 matching lines...) Expand all
147 # 151 #
148 # ifdef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED 152 # ifdef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED
149 # undef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED 153 # undef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED
150 # undef WIN32_LEAN_AND_MEAN 154 # undef WIN32_LEAN_AND_MEAN
151 # endif 155 # endif
152 # ifdef NOMINMAX_WAS_LOCALLY_DEFINED 156 # ifdef NOMINMAX_WAS_LOCALLY_DEFINED
153 # undef NOMINMAX_WAS_LOCALLY_DEFINED 157 # undef NOMINMAX_WAS_LOCALLY_DEFINED
154 # undef NOMINMAX 158 # undef NOMINMAX
155 # endif 159 # endif
156 # 160 #
157 # ifndef SK_ALWAYSBREAK
158 # define SK_ALWAYSBREAK(p) do { if (!(p)) { SkNO_RETURN_HINT(); __debugbreak( ); }} while (false)
159 # endif
160 #
161 # ifndef SK_A32_SHIFT 161 # ifndef SK_A32_SHIFT
162 # define SK_A32_SHIFT 24 162 # define SK_A32_SHIFT 24
163 # define SK_R32_SHIFT 16 163 # define SK_R32_SHIFT 16
164 # define SK_G32_SHIFT 8 164 # define SK_G32_SHIFT 8
165 # define SK_B32_SHIFT 0 165 # define SK_B32_SHIFT 0
166 # endif 166 # endif
167 # 167 #
168 #else 168 #endif
169 # ifndef SK_ALWAYSBREAK 169
170 # ifdef SK_DEBUG 170 #ifndef SK_ALWAYSBREAK
171 # include <stdio.h> 171 # ifdef SK_DEBUG
172 # define SK_ALWAYSBREAK(cond) do { if (cond) break; \ 172 # define SK_ALWAYSBREAK(cond) do { \
173 SkDebugf("%s:%d: failed assertion \"%s\"\n", \ 173 if (cond) break; \
174 __FILE__, __LINE__, #cond); SK_CRASH(); } while (false) 174 SkNO_RETURN_HINT(); \
175 # else 175 SkDebugf("%s:%d: failed assertion \"%s\"\n", __FILE__, __LINE__, # cond); \
176 # define SK_ALWAYSBREAK(cond) do { if (cond) break; SK_CRASH(); } while (fa lse) 176 SK_CRASH(); \
177 # endif 177 } while (false)
178 # else
179 # define SK_ALWAYSBREAK(cond) do { if (cond) break; SK_CRASH(); } while (fals e)
178 # endif 180 # endif
179 #endif 181 #endif
180 182
181 /** 183 /**
182 * We check to see if the SHIFT value has already been defined. 184 * We check to see if the SHIFT value has already been defined.
183 * if not, we define it ourself to some default values. We default to OpenGL 185 * if not, we define it ourself to some default values. We default to OpenGL
184 * order (in memory: r,g,b,a) 186 * order (in memory: r,g,b,a)
185 */ 187 */
186 #ifndef SK_A32_SHIFT 188 #ifndef SK_A32_SHIFT
187 # ifdef SK_CPU_BENDIAN 189 # ifdef SK_CPU_BENDIAN
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 416
415 #if defined(SK_GAMMA_EXPONENT) && defined(SK_GAMMA_SRGB) 417 #if defined(SK_GAMMA_EXPONENT) && defined(SK_GAMMA_SRGB)
416 # error "cannot define both SK_GAMMA_EXPONENT and SK_GAMMA_SRGB" 418 # error "cannot define both SK_GAMMA_EXPONENT and SK_GAMMA_SRGB"
417 #elif defined(SK_GAMMA_SRGB) 419 #elif defined(SK_GAMMA_SRGB)
418 # define SK_GAMMA_EXPONENT (0.0f) 420 # define SK_GAMMA_EXPONENT (0.0f)
419 #elif !defined(SK_GAMMA_EXPONENT) 421 #elif !defined(SK_GAMMA_EXPONENT)
420 # define SK_GAMMA_EXPONENT (2.2f) 422 # define SK_GAMMA_EXPONENT (2.2f)
421 #endif 423 #endif
422 424
423 #endif // SkPostConfig_DEFINED 425 #endif // SkPostConfig_DEFINED
OLDNEW
« no previous file with comments | « gyp/crash_handler.gyp ('k') | tools/CrashHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698