| #ifndef DMGpuSupport_DEFINED |
| #define DMGpuSupport_DEFINED |
| // Provides Ganesh to DM, |
| // or if it's not available, fakes it enough so most code doesn't have to know that. |
| // Ganesh is available. Yippee! |
| # include "GrContextFactory.h" |
| static const bool kGPUDisabled = false; |
| static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, |
| GrContextFactory::GLContextType type, |
| return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, samples); |
| // Ganesh is not available. Fake it. |
| typedef int GLContextType; |
| static const GLContextType kANGLE_GLContextType = 0, |
| kDebug_GLContextType = 0, |
| kNative_GLContextType = 0, |
| void destroyContexts() {} |
| static const bool kGPUDisabled = true; |
| static inline SkSurface* NewGpuSurface(GrContextFactory*, |
| GrContextFactory::GLContextType, |
| #endif//DMGpuSupport_DEFINED |