aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContextFactory.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/gpu/GrContextFactory.h b/include/gpu/GrContextFactory.h
index ea3b923201..d425b74416 100644
--- a/include/gpu/GrContextFactory.h
+++ b/include/gpu/GrContextFactory.h
@@ -28,7 +28,7 @@
* factory is destroyed (though the caller can always grab a ref on the returned
* GrContext to make it outlive the factory).
*/
-class GrContextFactory : GrNoncopyable {
+class GrContextFactory : GrNoncopyable {
public:
/**
* Types of GL contexts supported.
@@ -59,6 +59,27 @@ public:
}
}
+ static const char* GLContextTypeName(GLContextType type) {
+ switch (type) {
+ case kNative_GLContextType:
+ return "native";
+ case kNull_GLContextType:
+ return "null";
+#if SK_ANGLE
+ case kANGLE_GLContextType:
+ return "angle";
+#endif
+#if SK_MESA
+ case kMESA_GLContextType:
+ return "mesa";
+#endif
+ case kDebug_GLContextType:
+ return "debug";
+ default:
+ GrCrash("Unknown GL Context type.");
+ }
+ }
+
GrContextFactory() {
}