aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-01-11 08:30:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-11 08:30:48 -0800
commit4897ff20fc68242d8a3469721f381f03987a0723 (patch)
tree9cec74f643488eb87f0b53a2d9f9ca84975a1948
parent6d0872d9bd97de5301214a258e141dd5fbeecffc (diff)
Move atomicinc in GrTracing to behind branch
-rw-r--r--include/gpu/GrCaps.h4
-rw-r--r--include/gpu/GrConfig.h8
-rw-r--r--src/gpu/GrTracing.h96
3 files changed, 40 insertions, 68 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 217a446264..679777f9dd 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -118,11 +118,7 @@ public:
bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; }
bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; }
bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport; }
-#if GR_FORCE_GPU_TRACE_DEBUGGING
- bool gpuTracingSupport() const { return true; }
-#else
bool gpuTracingSupport() const { return fGpuTracingSupport; }
-#endif
bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSupport; }
bool oversizedStencilSupport() const { return fOversizedStencilSupport; }
bool textureBarrierSupport() const { return fTextureBarrierSupport; }
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h
index ffacb93911..26667b1c7e 100644
--- a/include/gpu/GrConfig.h
+++ b/include/gpu/GrConfig.h
@@ -185,12 +185,4 @@ typedef unsigned __int64 uint64_t;
#endif
#endif
-/**
- * GR_FORCE_GPU_TRACE_DEBUGGING will force gpu tracing/debug markers to be turned on. The trace
- * markers will be printed out instead of making the backend calls to push and pop them.
- */
-#if !defined(GR_FORCE_GPU_TRACE_DEBUGGING)
- #define GR_FORCE_GPU_TRACE_DEBUGGING 0
-#endif
-
#endif
diff --git a/src/gpu/GrTracing.h b/src/gpu/GrTracing.h
index d758c0329d..33d7f82ccb 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