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

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

Issue 1360653004: Remove SkNEW and SkDELETE macros (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Restore comment about new/delete Created 5 years, 3 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 | « include/core/SkImageGenerator.h ('k') | include/gpu/effects/GrExtractAlphaFragmentProcessor.h » ('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 // IWYU pragma: private, include "SkTypes.h" 8 // IWYU pragma: private, include "SkTypes.h"
9 9
10 #ifndef SkPostConfig_DEFINED 10 #ifndef SkPostConfig_DEFINED
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 # if SK_HAS_COMPILER_FEATURE(attribute_analyzer_noreturn) 93 # if SK_HAS_COMPILER_FEATURE(attribute_analyzer_noreturn)
94 static inline void SkNO_RETURN_HINT() __attribute__((analyzer_noreturn)); 94 static inline void SkNO_RETURN_HINT() __attribute__((analyzer_noreturn));
95 static inline void SkNO_RETURN_HINT() {} 95 static inline void SkNO_RETURN_HINT() {}
96 # else 96 # else
97 # define SkNO_RETURN_HINT() do {} while (false) 97 # define SkNO_RETURN_HINT() do {} while (false)
98 # endif 98 # endif
99 #endif 99 #endif
100 100
101 /////////////////////////////////////////////////////////////////////////////// 101 ///////////////////////////////////////////////////////////////////////////////
102 102
103 #ifndef SkNEW 103 // TODO(mdempsky): Move elsewhere as appropriate.
104 # include <new> 104 #include <new>
105 # define SkNEW(type_name) (new type_name)
106 # define SkNEW_ARGS(type_name, args) (new type_name args)
107 # define SkNEW_ARRAY(type_name, count) (new type_name[(count)])
108 # define SkNEW_PLACEMENT(buf, type_name) (new (buf) type_name)
109 # define SkNEW_PLACEMENT_ARGS(buf, type_name, args) (new (buf) type_name args)
110 # define SkDELETE(obj) (delete (obj))
111 # define SkDELETE_ARRAY(array) (delete[] (array))
112 #endif
113 105
114 #ifndef SK_CRASH 106 #ifndef SK_CRASH
115 # ifdef SK_BUILD_FOR_WIN 107 # ifdef SK_BUILD_FOR_WIN
116 # define SK_CRASH() __debugbreak() 108 # define SK_CRASH() __debugbreak()
117 # else 109 # else
118 # if 1 // set to 0 for infinite loop, which can help connecting gdb 110 # if 1 // set to 0 for infinite loop, which can help connecting gdb
119 # define SK_CRASH() do { SkNO_RETURN_HINT(); *(int *)(uintptr_t)0xbbadbeef = 0; } while (false) 111 # define SK_CRASH() do { SkNO_RETURN_HINT(); *(int *)(uintptr_t)0xbbadbeef = 0; } while (false)
120 # else 112 # else
121 # define SK_CRASH() do { SkNO_RETURN_HINT(); } while (true) 113 # define SK_CRASH() do { SkNO_RETURN_HINT(); } while (true)
122 # endif 114 # endif
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 # define SK_GAMMA_EXPONENT (2.2f) 349 # define SK_GAMMA_EXPONENT (2.2f)
358 #endif 350 #endif
359 351
360 ////////////////////////////////////////////////////////////////////// 352 //////////////////////////////////////////////////////////////////////
361 353
362 #ifndef GR_TEST_UTILS 354 #ifndef GR_TEST_UTILS
363 # define GR_TEST_UTILS 1 355 # define GR_TEST_UTILS 1
364 #endif 356 #endif
365 357
366 #endif // SkPostConfig_DEFINED 358 #endif // SkPostConfig_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkImageGenerator.h ('k') | include/gpu/effects/GrExtractAlphaFragmentProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698