diff options
Diffstat (limited to 'src/gpu/GrGpuFactory.cpp')
-rw-r--r-- | src/gpu/GrGpuFactory.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/gpu/GrGpuFactory.cpp b/src/gpu/GrGpuFactory.cpp index 74adf98236..bd572e6860 100644 --- a/src/gpu/GrGpuFactory.cpp +++ b/src/gpu/GrGpuFactory.cpp @@ -9,38 +9,12 @@ #include "GrGpuFactory.h" -#include "gl/GrGLConfig.h" - #include "GrGpu.h" +#include "gl/GrGLConfig.h" #include "gl/GrGLGpu.h" -static GrGpu* gl_gpu_create(GrBackendContext backendContext, GrContext* context) { - const GrGLInterface* glInterface = NULL; - SkAutoTUnref<const GrGLInterface> glInterfaceUnref; - - glInterface = reinterpret_cast<const GrGLInterface*>(backendContext); - if (NULL == glInterface) { - glInterface = GrGLDefaultInterface(); - // By calling GrGLDefaultInterface we've taken a ref on the - // returned object. We only want to hold that ref until after - // the GrGpu is constructed and has taken ownership. - glInterfaceUnref.reset(glInterface); - } - if (NULL == glInterface) { -#ifdef SK_DEBUG - SkDebugf("No GL interface provided!\n"); -#endif - return NULL; - } - GrGLContext ctx(glInterface); - if (ctx.isInitialized()) { - return SkNEW_ARGS(GrGLGpu, (ctx, context)); - } - return NULL; -} - static const int kMaxNumBackends = 4; -static CreateGpuProc gGpuFactories[kMaxNumBackends] = {gl_gpu_create, NULL, NULL, NULL}; +static CreateGpuProc gGpuFactories[kMaxNumBackends] = {GrGLGpu::Create, NULL, NULL, NULL}; GrGpuFactoryRegistrar::GrGpuFactoryRegistrar(int i, CreateGpuProc proc) { gGpuFactories[i] = proc; |