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

Unified Diff: src/gpu/GrTracing.h

Issue 1571603003: Move atomicinc in GrTracing to behind branch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrConfig.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTracing.h
diff --git a/src/gpu/GrTracing.h b/src/gpu/GrTracing.h
index d758c0329d9afdc070f61d04d25a20039985b40b..33d7f82ccbfd8d6948bf01f6020f69c7c246253e 100644
--- a/src/gpu/GrTracing.h
+++ b/src/gpu/GrTracing.h
@@ -60,72 +60,56 @@ private:
* cpu and gpu (if gpu tracing enabled) for the current scope.
* marker is of type const char* and target is of type GrDrawTarget*
*/
-#define GR_CREATE_TRACE_MARKER(name, target) \
- INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED(name, target)
-
-#define GR_CREATE_TRACE_MARKER1(name, target, arg1_name, arg1_val) \
- INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED(name, target, arg1_name, arg1_val)
-
-#define INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED(name, target, ...) \
+#define GR_CREATE_TRACE_MARKER(name, target) \
+ /* Chromium tracing */ \
+ static int SK_MACRO_APPEND_LINE(name_counter) = 0; \
+ bool SK_MACRO_APPEND_LINE(gpuTracingEnabled); \
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), \
+ &SK_MACRO_APPEND_LINE(gpuTracingEnabled)); \
+ if (SK_MACRO_APPEND_LINE(gpuTracingEnabled)) { \
+ INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED(name, SK_MACRO_APPEND_LINE(name_counter), target) \
+ } \
+ INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), name, \
+ "id", SK_MACRO_APPEND_LINE(name_counter));
+
+#define INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED(name, name_counter, target) \
static const char* SK_MACRO_APPEND_LINE(static_name) = name; \
- static int SK_MACRO_APPEND_LINE(name_counter) = 0; \
INTERNAL_GR_CREATE_TRACE_MARKER(SK_MACRO_APPEND_LINE(static_name), \
- SK_MACRO_APPEND_LINE(name_counter), \
- target, ##__VA_ARGS__) \
- sk_atomic_inc(&SK_MACRO_APPEND_LINE(name_counter));
+ name_counter, \
+ target) \
+ sk_atomic_inc(&name_counter);
#define INTERNAL_GR_CREATE_TRACE_MARKER(name, name_counter, target, ...) \
GR_CREATE_GPU_TRACE_MARKER(name, name_counter, target) \
- INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"),name, \
- "id", name_counter, ##__VA_ARGS__);
-
-#if GR_FORCE_GPU_TRACE_DEBUGGING
-#define GR_CREATE_GPU_TRACE_MARKER(name, name_counter, target) \
- GrGpuTraceMarkerGenerator SK_MACRO_APPEND_LINE(TMG)(target); \
- SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter);
-#else
-#define GR_CREATE_GPU_TRACE_MARKER(name, name_counter, target) \
- GrGpuTraceMarkerGenerator SK_MACRO_APPEND_LINE(TMG)(target); \
- bool SK_MACRO_APPEND_LINE(gpuTracingEnabled); \
- TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), \
- &SK_MACRO_APPEND_LINE(gpuTracingEnabled)); \
- if (SK_MACRO_APPEND_LINE(gpuTracingEnabled)) { \
- SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
- }
-#endif
-
-#define GR_CREATE_TRACE_MARKER_CONTEXT(name, context) \
- INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, context)
-#define GR_CREATE_TRACE_MARKER_CONTEXT1(name, context, arg1_name, arg1_val) \
- INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, context, arg1_name, arg1_val)
-
-#define INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, context, ...) \
+#define GR_CREATE_GPU_TRACE_MARKER(name, name_counter, target) \
+ GrGpuTraceMarkerGenerator SK_MACRO_APPEND_LINE(TMG)(target); \
+ SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
+
+#define GR_CREATE_TRACE_MARKER_CONTEXT(name, context) \
+ /* Chromium tracing */ \
+ static int SK_MACRO_APPEND_LINE(name_counter) = 0; \
+ bool SK_MACRO_APPEND_LINE(gpuTracingEnabled); \
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), \
+ &SK_MACRO_APPEND_LINE(gpuTracingEnabled)); \
+ if (SK_MACRO_APPEND_LINE(gpuTracingEnabled)) { \
+ INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, SK_MACRO_APPEND_LINE(name_counter), context)\
+ } \
+ INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), name, \
+ "id", SK_MACRO_APPEND_LINE(name_counter));
+
+#define INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, name_counter, context) \
static const char* SK_MACRO_APPEND_LINE(static_name) = name; \
- static int SK_MACRO_APPEND_LINE(name_counter) = 0; \
INTERNAL_GR_CREATE_TRACE_MARKER_C(SK_MACRO_APPEND_LINE(static_name), \
- SK_MACRO_APPEND_LINE(name_counter), \
- context, ##__VA_ARGS__) \
- sk_atomic_inc(&SK_MACRO_APPEND_LINE(name_counter));
+ name_counter, \
+ context) \
+ sk_atomic_inc(&name_counter);
#define INTERNAL_GR_CREATE_TRACE_MARKER_C(name, name_counter, context, ...) \
GR_CREATE_GPU_TRACE_MARKER_C(name, name_counter, context) \
- INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"),name, \
- "id", name_counter, ##__VA_ARGS__);
-
-#if GR_FORCE_GPU_TRACE_DEBUGGING
-#define GR_CREATE_GPU_TRACE_MARKER_C(name, name_counter, context) \
- GrGpuTraceMarkerGeneratorContext SK_MACRO_APPEND_LINE(TMG)(context); \
- SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter);
-#else
-#define GR_CREATE_GPU_TRACE_MARKER_C(name, name_counter, context) \
- GrGpuTraceMarkerGeneratorContext SK_MACRO_APPEND_LINE(TMG)(context); \
- bool SK_MACRO_APPEND_LINE(gpuTracingEnabled); \
- TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), \
- &SK_MACRO_APPEND_LINE(gpuTracingEnabled)); \
- if (SK_MACRO_APPEND_LINE(gpuTracingEnabled)) { \
- SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
- }
-#endif
+
+#define GR_CREATE_GPU_TRACE_MARKER_C(name, name_counter, context) \
+ GrGpuTraceMarkerGeneratorContext SK_MACRO_APPEND_LINE(TMG)(context); \
+ SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
#endif
« no previous file with comments | « include/gpu/GrConfig.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698