| OLD | NEW |
| 1 #ifndef DMGpuSupport_DEFINED | 1 #ifndef DMGpuSupport_DEFINED |
| 2 #define DMGpuSupport_DEFINED | 2 #define DMGpuSupport_DEFINED |
| 3 | 3 |
| 4 // Provides Ganesh to DM, | 4 // Provides Ganesh to DM, |
| 5 // or if it's not available, fakes it enough so most code doesn't have to know t
hat. | 5 // or if it's not available, fakes it enough so most code doesn't have to know t
hat. |
| 6 | 6 |
| 7 #include "SkSurface.h" | 7 #include "SkSurface.h" |
| 8 | 8 |
| 9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
| 10 | 10 |
| 11 // Ganesh is available. Yippee! | 11 // Ganesh is available. Yippee! |
| 12 | 12 |
| 13 # include "GrContext.h" | 13 # include "GrContext.h" |
| 14 # include "GrContextFactory.h" | 14 # include "GrContextFactory.h" |
| 15 | 15 |
| 16 namespace DM { | 16 namespace DM { |
| 17 | 17 |
| 18 static const bool kGPUDisabled = false; | 18 static const bool kGPUDisabled = false; |
| 19 | 19 |
| 20 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, | 20 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, |
| 21 GrContextFactory::GLContextType type, | 21 GrContextFactory::GLContextType type, |
| 22 GrGLStandard gpuAPI, | 22 GrGLStandard gpuAPI, |
| 23 SkImageInfo info, | 23 SkImageInfo info, |
| 24 int samples) { | 24 int samples, |
| 25 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, sample
s, NULL); | 25 bool useDFText) { |
| 26 uint32_t flags = useDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0
; |
| 27 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
| 28 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), info, sample
s, &props); |
| 26 } | 29 } |
| 27 | 30 |
| 28 } // namespace DM | 31 } // namespace DM |
| 29 | 32 |
| 30 #else// !SK_SUPPORT_GPU | 33 #else// !SK_SUPPORT_GPU |
| 31 | 34 |
| 32 // Ganesh is not available. Fake it. | 35 // Ganesh is not available. Fake it. |
| 33 | 36 |
| 34 enum GrGLStandard { | 37 enum GrGLStandard { |
| 35 kNone_GrGLStandard, | 38 kNone_GrGLStandard, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 namespace DM { | 58 namespace DM { |
| 56 | 59 |
| 57 static const bool kGPUDisabled = true; | 60 static const bool kGPUDisabled = true; |
| 58 | 61 |
| 59 static inline SkSurface* NewGpuSurface(GrContextFactory*, | 62 static inline SkSurface* NewGpuSurface(GrContextFactory*, |
| 60 GrContextFactory::GLContextType, | 63 GrContextFactory::GLContextType, |
| 61 GrGLStandard, | 64 GrGLStandard, |
| 62 SkImageInfo, | 65 SkImageInfo, |
| 63 int) { | 66 int, |
| 67 bool) { |
| 64 return NULL; | 68 return NULL; |
| 65 } | 69 } |
| 66 | 70 |
| 67 } // namespace DM | 71 } // namespace DM |
| 68 | 72 |
| 69 #endif//SK_SUPPORT_GPU | 73 #endif//SK_SUPPORT_GPU |
| 70 | 74 |
| 71 #endif//DMGpuSupport_DEFINED | 75 #endif//DMGpuSupport_DEFINED |
| OLD | NEW |