Revert of Rename enums in GrContextFactory to remove "GL" (patchset #4 id:60001 of https://codereview.chromium.org/1845923004/ )
Reason for revert:
Many GM images unexpectedly changed with this CL.
Original issue's description:
> Rename enums in GrContextFactory to remove "GL"
>
> Also, remove kNative as a separate context type and instead make it an alias for kGL or kGLES based on OS.
>
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845923004
>
> Committed: https://skia.googlesource.com/skia/+/2d9c6f81353597aebf5934547e5cba7a872196fb
TBR=egdaniel@google.com,jvanverth@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
Review URL: https://codereview.chromium.org/1856703002
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index b084b1d..1ee3130 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -201,43 +201,47 @@
}
static bool parse_option_gpu_api(const SkString& value,
SkCommandLineConfigGpu::ContextType* outContextType) {
+ if (value.equals("native")) {
+ *outContextType = GrContextFactory::kNative_GLContextType;
+ return true;
+ }
if (value.equals("gl")) {
- *outContextType = GrContextFactory::kGL_ContextType;
+ *outContextType = GrContextFactory::kGL_GLContextType;
return true;
}
if (value.equals("gles")) {
- *outContextType = GrContextFactory::kGLES_ContextType;
+ *outContextType = GrContextFactory::kGLES_GLContextType;
return true;
}
if (value.equals("debug")) {
- *outContextType = GrContextFactory::kDebugGL_ContextType;
+ *outContextType = GrContextFactory::kDebug_GLContextType;
return true;
}
if (value.equals("null")) {
- *outContextType = GrContextFactory::kNullGL_ContextType;
+ *outContextType = GrContextFactory::kNull_GLContextType;
return true;
}
#if SK_ANGLE
#ifdef SK_BUILD_FOR_WIN
if (value.equals("angle")) {
- *outContextType = GrContextFactory::kANGLE_ContextType;
+ *outContextType = GrContextFactory::kANGLE_GLContextType;
return true;
}
#endif
if (value.equals("angle-gl")) {
- *outContextType = GrContextFactory::kANGLE_GL_ContextType;
+ *outContextType = GrContextFactory::kANGLE_GL_GLContextType;
return true;
}
#endif
#if SK_COMMAND_BUFFER
if (value.equals("commandbuffer")) {
- *outContextType = GrContextFactory::kCommandBuffer_ContextType;
+ *outContextType = GrContextFactory::kCommandBuffer_GLContextType;
return true;
}
#endif
#if SK_MESA
if (value.equals("mesa")) {
- *outContextType = GrContextFactory::kMESA_ContextType;
+ *outContextType = GrContextFactory::kMESA_GLContextType;
return true;
}
#endif
@@ -269,7 +273,7 @@
const SkString& options) {
// Defaults for GPU backend.
bool seenAPI = false;
- SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNativeGL_ContextType;
+ SkCommandLineConfigGpu::ContextType contextType = GrContextFactory::kNative_GLContextType;
bool seenUseNVPR = false;
bool useNVPR = false;
bool seenUseDIText =false;