Chromium Code Reviews| Index: include/gpu/GrContext.h |
| diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
| index 77aef60d8d972694182a620ca39c95ba184c8180..2c91b987bb1561bed4ee8ff3545156a4a3d8d939 100644 |
| --- a/include/gpu/GrContext.h |
| +++ b/include/gpu/GrContext.h |
| @@ -42,17 +42,24 @@ class GrStrokeInfo; |
| class GrSoftwarePathRenderer; |
| class SkGpuDevice; |
| +// Takes a pointer to a GrContext, and will suppress prints if required |
| +#define GrContextDebugf(context, format, ...) \ |
|
bsalomon
2015/05/12 13:31:55
align the \s?
What does/should this do in RELEASE
bsalomon
2015/05/12 13:51:09
Ok, I asked because all the current callers only c
|
| + if (!context->suppressPrints()) { \ |
| + SkDebugf(format, ##__VA_ARGS__); \ |
| + } |
| + |
| class SK_API GrContext : public SkRefCnt { |
| public: |
| SK_DECLARE_INST_COUNT(GrContext) |
| struct Options { |
| - Options() : fDrawPathToCompressedTexture(false) { } |
| + Options() : fDrawPathToCompressedTexture(false), fSuppressPrints(false) { } |
| // EXPERIMENTAL |
| // May be removed in the future, or may become standard depending |
| // on the outcomes of a variety of internal tests. |
| bool fDrawPathToCompressedTexture; |
| + bool fSuppressPrints; |
| }; |
| /** |
| @@ -529,6 +536,7 @@ public: |
| GrResourceProvider* resourceProvider() { return fResourceProvider; } |
| const GrResourceProvider* resourceProvider() const { return fResourceProvider; } |
| GrResourceCache* getResourceCache() { return fResourceCache; } |
| + bool suppressPrints() const { return fOptions.fSuppressPrints; } |
| // Called by tests that draw directly to the context via GrDrawTarget |
| void getTestTarget(GrTestTarget*); |