Index: tools/gpu/GrContextFactory.cpp |
diff --git a/src/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp |
old mode 100755 |
new mode 100644 |
similarity index 81% |
rename from src/gpu/GrContextFactory.cpp |
rename to tools/gpu/GrContextFactory.cpp |
index 4e1a3e0d64a50de804e9a21b8321c6505cf6061f..5126caff197212c42d634e462a5cf2bc97fc237b |
--- a/src/gpu/GrContextFactory.cpp |
+++ b/tools/gpu/GrContextFactory.cpp |
@@ -9,24 +9,25 @@ |
#include "GrContextFactory.h" |
#if SK_ANGLE |
- #include "gl/angle/SkANGLEGLContext.h" |
+ #include "gl/angle/GLContext_angle.h" |
#endif |
#if SK_COMMAND_BUFFER |
- #include "gl/command_buffer/SkCommandBufferGLContext.h" |
+ #include "gl/command_buffer/GLContext_command_buffer.h" |
#endif |
-#include "gl/debug/SkDebugGLContext.h" |
+#include "gl/debug/DebugGLContext.h" |
#if SK_MESA |
- #include "gl/mesa/SkMesaGLContext.h" |
+ #include "gl/mesa/GLContext_mesa.h" |
#endif |
#if SK_VULKAN |
#include "vk/GrVkBackendContext.h" |
#endif |
-#include "gl/SkGLContext.h" |
-#include "gl/SkNullGLContext.h" |
+#include "gl/GLContext.h" |
+#include "gl/null/NullGLContext.h" |
#include "gl/GrGLGpu.h" |
#include "GrCaps.h" |
-GrContextFactory::GrContextFactory() { } |
+namespace sk_gpu_test { |
+GrContextFactory::GrContextFactory() {} |
GrContextFactory::GrContextFactory(const GrContextOptions& opts) |
: fGlobalOptions(opts) { |
@@ -75,43 +76,43 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(GLContextType typ |
return ContextInfo(context.fGrContext, context.fGLContext); |
} |
} |
- SkAutoTDelete<SkGLContext> glCtx; |
+ SkAutoTDelete<GLContext> glCtx; |
SkAutoTUnref<GrContext> grCtx; |
switch (type) { |
case kNative_GLContextType: |
- glCtx.reset(SkCreatePlatformGLContext(kNone_GrGLStandard)); |
+ glCtx.reset(CreatePlatformGLContext(kNone_GrGLStandard)); |
break; |
case kGL_GLContextType: |
- glCtx.reset(SkCreatePlatformGLContext(kGL_GrGLStandard)); |
+ glCtx.reset(CreatePlatformGLContext(kGL_GrGLStandard)); |
break; |
case kGLES_GLContextType: |
- glCtx.reset(SkCreatePlatformGLContext(kGLES_GrGLStandard)); |
+ glCtx.reset(CreatePlatformGLContext(kGLES_GrGLStandard)); |
break; |
#if SK_ANGLE |
#ifdef SK_BUILD_FOR_WIN |
case kANGLE_GLContextType: |
- glCtx.reset(SkANGLEGLContext::CreateDirectX()); |
+ glCtx.reset(CreateANGLEDirect3DGLContext()); |
break; |
#endif |
case kANGLE_GL_GLContextType: |
- glCtx.reset(SkANGLEGLContext::CreateOpenGL()); |
+ glCtx.reset(CreateANGLEOpenGLGLContext()); |
break; |
#endif |
#if SK_COMMAND_BUFFER |
case kCommandBuffer_GLContextType: |
- glCtx.reset(SkCommandBufferGLContext::Create()); |
+ glCtx.reset(CommandBufferGLContext::Create()); |
break; |
#endif |
#if SK_MESA |
case kMESA_GLContextType: |
- glCtx.reset(SkMesaGLContext::Create()); |
+ glCtx.reset(CreateMesaGLContext()); |
break; |
#endif |
case kNull_GLContextType: |
- glCtx.reset(SkNullGLContext::Create()); |
+ glCtx.reset(CreateNullGLContext()); |
break; |
case kDebug_GLContextType: |
- glCtx.reset(SkDebugGLContext::Create()); |
+ glCtx.reset(CreateDebugGLContext()); |
break; |
} |
if (nullptr == glCtx.get()) { |
@@ -157,3 +158,4 @@ GrContextFactory::ContextInfo GrContextFactory::getContextInfo(GLContextType typ |
context.fOptions = options; |
return ContextInfo(context.fGrContext, context.fGLContext); |
} |
+} // namespace sk_gpu_test |