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

Unified Diff: include/gpu/GrContext.h

Issue 1128903008: add option to supress prints on context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak Created 5 years, 7 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 | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | src/gpu/gl/GrGLProgramDataManager.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 77aef60d8d972694182a620ca39c95ba184c8180..4b745daee2a37aabfaf2142b08645d364a3b2eeb 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 GrContextSuppressf(context, format, ...) \
+ 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*);
« no previous file with comments | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | src/gpu/gl/GrGLProgramDataManager.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698