aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/GrContextFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gpu/GrContextFactory.cpp')
-rwxr-xr-xtools/gpu/GrContextFactory.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 18fbef8113..c232121332 100755
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -74,16 +74,8 @@ void GrContextFactory::releaseResourcesAndAbandonContexts() {
}
}
-#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_MAC)
-const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType =
- GrContextFactory::kGL_ContextType;
-#else
-const GrContextFactory::ContextType GrContextFactory::kNativeGL_ContextType =
- GrContextFactory::kGLES_ContextType;
-#endif
-
-GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type,
- ContextOptions options) {
+GrContextFactory::ContextInfo GrContextFactory::getContextInfo(GLContextType type,
+ GLContextOptions options) {
for (int i = 0; i < fContexts.count(); ++i) {
Context& context = fContexts[i];
if (!context.fGLContext) {
@@ -98,36 +90,39 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type,
SkAutoTDelete<GLTestContext> glCtx;
SkAutoTUnref<GrContext> grCtx;
switch (type) {
- case kGL_ContextType:
+ case kNative_GLContextType:
+ glCtx.reset(CreatePlatformGLTestContext(kNone_GrGLStandard));
+ break;
+ case kGL_GLContextType:
glCtx.reset(CreatePlatformGLTestContext(kGL_GrGLStandard));
break;
- case kGLES_ContextType:
+ case kGLES_GLContextType:
glCtx.reset(CreatePlatformGLTestContext(kGLES_GrGLStandard));
break;
#if SK_ANGLE
#ifdef SK_BUILD_FOR_WIN
- case kANGLE_ContextType:
+ case kANGLE_GLContextType:
glCtx.reset(CreateANGLEDirect3DGLTestContext());
break;
#endif
- case kANGLE_GL_ContextType:
+ case kANGLE_GL_GLContextType:
glCtx.reset(CreateANGLEOpenGLGLTestContext());
break;
#endif
#if SK_COMMAND_BUFFER
- case kCommandBuffer_ContextType:
+ case kCommandBuffer_GLContextType:
glCtx.reset(CommandBufferGLTestContext::Create());
break;
#endif
#if SK_MESA
- case kMESA_ContextType:
+ case kMESA_GLContextType:
glCtx.reset(CreateMesaGLTestContext());
break;
#endif
- case kNullGL_ContextType:
+ case kNull_GLContextType:
glCtx.reset(CreateNullGLTestContext());
break;
- case kDebugGL_ContextType:
+ case kDebug_GLContextType:
glCtx.reset(CreateDebugGLTestContext());
break;
}
@@ -139,7 +134,7 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type,
// Block NVPR from non-NVPR types.
SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx->gl()));
- if (!(kEnableNVPR_ContextOptions & options)) {
+ if (!(kEnableNVPR_GLContextOptions & options)) {
glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface));
if (!glInterface) {
return ContextInfo();
@@ -148,7 +143,7 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type,
glCtx->makeCurrent();
#ifdef SK_VULKAN
- if (kEnableNVPR_ContextOptions & options) {
+ if (kEnableNVPR_GLContextOptions & options) {
return ContextInfo();
} else {
GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(GrVkBackendContext::Create());
@@ -161,12 +156,12 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(ContextType type,
if (!grCtx.get()) {
return ContextInfo();
}
- if (kEnableNVPR_ContextOptions & options) {
+ if (kEnableNVPR_GLContextOptions & options) {
if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
return ContextInfo();
}
}
- if (kRequireSRGBSupport_ContextOptions & options) {
+ if (kRequireSRGBSupport_GLContextOptions & options) {
if (!grCtx->caps()->srgbSupport()) {
return ContextInfo();
}