1 #ifndef DMGpuSupport_DEFINED
2 #define DMGpuSupport_DEFINED
4 // Provides Ganesh to DM,
5 // or if it's not available, fakes it enough so most code doesn't have to know that.
11 // Ganesh is available. Yippee!
13 # include "GrContext.h"
14 # include "GrContextFactory.h"
18 static const bool kGPUDisabled = false;
20 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory,
21 GrContextFactory::GLContextType type,
25 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, samples);
30 #else// !SK_SUPPORT_GPU
32 // Ganesh is not available. Fake it.
40 class GrContextFactory {
42 typedef int GLContextType;
44 static const GLContextType kANGLE_GLContextType = 0,
45 kDebug_GLContextType = 0,
46 kMESA_GLContextType = 0,
47 kNVPR_GLContextType = 0,
48 kNative_GLContextType = 0,
49 kNull_GLContextType = 0;
50 void destroyContexts() {}
52 void abandonContexts() {}
57 static const bool kGPUDisabled = true;
59 static inline SkSurface* NewGpuSurface(GrContextFactory*,
60 GrContextFactory::GLContextType,
69 #endif//SK_SUPPORT_GPU
71 #endif//DMGpuSupport_DEFINED