aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/GrContextFactory.h
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-09-13 10:41:49 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-13 10:41:50 -0700
commit6270e558c31b75d02db6f598e93f2e3b701ccb7f (patch)
tree9c330b8761f62ef031f0913aaba00e74b2c91ea3 /tools/gpu/GrContextFactory.h
parent37283c28aa5bea2204c18956e74f83b238d7a891 (diff)
Add ContextOptions field to SkCommandLineConfigGpu
Reduces duplicate code by computing the ContextOptions in one spot. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2337163002 Review-Url: https://codereview.chromium.org/2337163002
Diffstat (limited to 'tools/gpu/GrContextFactory.h')
-rw-r--r--tools/gpu/GrContextFactory.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h
index f70ebea9ad..d5e87a42f4 100644
--- a/tools/gpu/GrContextFactory.h
+++ b/tools/gpu/GrContextFactory.h
@@ -89,11 +89,11 @@ public:
* Options for GL context creation. For historical and testing reasons the options will default
* to not using GL_NV_path_rendering extension even when the driver supports it.
*/
- enum ContextOptions {
- kNone_ContextOptions = 0x0,
- kEnableNVPR_ContextOptions = 0x1,
- kUseInstanced_ContextOptions = 0x2,
- kRequireSRGBSupport_ContextOptions = 0x4,
+ enum class ContextOptions {
+ kNone = 0x0,
+ kEnableNVPR = 0x1,
+ kUseInstanced = 0x2,
+ kRequireSRGBSupport = 0x4,
};
static ContextType NativeContextTypeForBackend(GrBackend backend) {
@@ -163,11 +163,11 @@ public:
* Get a context initialized with a type of GL context. It also makes the GL context current.
*/
ContextInfo getContextInfo(ContextType type,
- ContextOptions options = kNone_ContextOptions);
+ ContextOptions options = ContextOptions::kNone);
/**
* Get a GrContext initialized with a type of GL context. It also makes the GL context current.
*/
- GrContext* get(ContextType type, ContextOptions options = kNone_ContextOptions) {
+ GrContext* get(ContextType type, ContextOptions options = ContextOptions::kNone) {
return this->getContextInfo(type, options).grContext();
}
const GrContextOptions& getGlobalOptions() const { return fGlobalOptions; }
@@ -186,4 +186,7 @@ private:
const GrContextOptions fGlobalOptions;
};
} // namespace sk_gpu_test
+
+GR_MAKE_BITFIELD_CLASS_OPS(sk_gpu_test::GrContextFactory::ContextOptions);
+
#endif