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:
egdaniel 2014-08-04 12:54:39 -07:00 committed by Commit bot
parent ad82ed67df
commit 6d7f5faeb3
4 changed files with 14 additions and 22 deletions

View File

@ -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);

View File

@ -110,7 +110,6 @@ GrContext::GrContext() {
fOvalRenderer = NULL;
fViewMatrix.reset();
fMaxTextureSizeOverride = 1 << 20;
fGpuTracingEnabled = false;
}
bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {

View File

@ -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();
}
////////////////////////////////////////////////////////////////////////////
/**

View File

@ -87,12 +87,14 @@ private:
#define GR_CREATE_GPU_TRACE_MARKER(name, name_counter, target) \
GrGpuTraceMarkerGenerator SK_MACRO_APPEND_LINE(TMG)(target); \
if (target->isGpuTracingEnabled()) { \
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)
@ -114,7 +116,10 @@ private:
#define GR_CREATE_GPU_TRACE_MARKER_C(name, name_counter, context) \
GrGpuTraceMarkerGeneratorContext SK_MACRO_APPEND_LINE(TMG)(context); \
if (context->isGpuTracingEnabled()) { \
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); \
}