Enable gpu Debug markers if tracing category skia.gpu is enabled
BUG=skia: R=bsalomon@google.com Author: egdaniel@google.com Review URL: https://codereview.chromium.org/438023004
This commit is contained in:
parent
ad82ed67df
commit
6d7f5faeb3
@ -921,11 +921,6 @@ public:
|
||||
// Called by tests that draw directly to the context via GrDrawTarget
|
||||
void getTestTarget(GrTestTarget*);
|
||||
|
||||
// Functions for managing gpu trace markers
|
||||
bool isGpuTracingEnabled() const { return fGpuTracingEnabled; }
|
||||
void enableGpuTracing() { fGpuTracingEnabled = true; }
|
||||
void disableGpuTracing() { fGpuTracingEnabled = false; }
|
||||
|
||||
void addGpuTraceMarker(const GrGpuTraceMarker* marker);
|
||||
void removeGpuTraceMarker(const GrGpuTraceMarker* marker);
|
||||
|
||||
@ -992,8 +987,6 @@ private:
|
||||
|
||||
int fMaxTextureSizeOverride;
|
||||
|
||||
bool fGpuTracingEnabled;
|
||||
|
||||
GrContext(); // init must be called after the constructor.
|
||||
bool init(GrBackend, GrBackendContext);
|
||||
|
||||
|
@ -110,7 +110,6 @@ GrContext::GrContext() {
|
||||
fOvalRenderer = NULL;
|
||||
fViewMatrix.reset();
|
||||
fMaxTextureSizeOverride = 1 << 20;
|
||||
fGpuTracingEnabled = false;
|
||||
}
|
||||
|
||||
bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
|
||||
|
@ -547,11 +547,6 @@ public:
|
||||
const GrDeviceCoordTexture* dstCopy) {
|
||||
this->onDrawPaths(pathRange, indices, count, transforms, transformsType, fill, dstCopy);
|
||||
}
|
||||
|
||||
inline bool isGpuTracingEnabled() const {
|
||||
return this->getContext()->isGpuTracingEnabled();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
@ -85,14 +85,16 @@ private:
|
||||
INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"),name, \
|
||||
"id", name_counter, ##__VA_ARGS__);
|
||||
|
||||
#define GR_CREATE_GPU_TRACE_MARKER(name, name_counter, target) \
|
||||
GrGpuTraceMarkerGenerator SK_MACRO_APPEND_LINE(TMG)(target); \
|
||||
if (target->isGpuTracingEnabled()) { \
|
||||
SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
|
||||
#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); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define GR_CREATE_TRACE_MARKER_CONTEXT(name, context) \
|
||||
INTERNAL_GR_CREATE_TRACE_MARKER_SCOPED_C(name, context)
|
||||
|
||||
@ -112,10 +114,13 @@ private:
|
||||
INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("skia.gpu"),name, \
|
||||
"id", name_counter, ##__VA_ARGS__);
|
||||
|
||||
#define GR_CREATE_GPU_TRACE_MARKER_C(name, name_counter, context) \
|
||||
GrGpuTraceMarkerGeneratorContext SK_MACRO_APPEND_LINE(TMG)(context); \
|
||||
if (context->isGpuTracingEnabled()) { \
|
||||
SK_MACRO_APPEND_LINE(TMG).initialize(name, &name_counter); \
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user