| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef DMGpuSupport_DEFINED | 8 #ifndef DMGpuSupport_DEFINED |
| 9 #define DMGpuSupport_DEFINED | 9 #define DMGpuSupport_DEFINED |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 # include "GrContext.h" | 24 # include "GrContext.h" |
| 25 # include "GrContextFactory.h" | 25 # include "GrContextFactory.h" |
| 26 | 26 |
| 27 namespace DM { | 27 namespace DM { |
| 28 | 28 |
| 29 static const bool kGPUDisabled = false; | 29 static const bool kGPUDisabled = false; |
| 30 | 30 |
| 31 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, | 31 static inline SkSurface* NewGpuSurface(GrContextFactory* grFactory, |
| 32 GrContextFactory::GLContextType type, | 32 GrContextFactory::GLContextType type, |
| 33 GrContextFactory::GLContextOptions option
s, |
| 33 GrGLStandard gpuAPI, | 34 GrGLStandard gpuAPI, |
| 34 SkImageInfo info, | 35 SkImageInfo info, |
| 35 int samples, | 36 int samples, |
| 36 bool useDIText) { | 37 bool useDIText) { |
| 37 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag
: 0; | 38 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag
: 0; |
| 38 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 39 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
| 39 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI), SkSurface::k
No_Budgeted, | 40 return SkSurface::NewRenderTarget(grFactory->get(type, gpuAPI, options), |
| 40 info, samples, &props); | 41 SkSurface::kNo_Budgeted, info, samples, &p
rops); |
| 41 } | 42 } |
| 42 | 43 |
| 43 } // namespace DM | 44 } // namespace DM |
| 44 | 45 |
| 45 #else// !SK_SUPPORT_GPU | 46 #else// !SK_SUPPORT_GPU |
| 46 | 47 |
| 47 // Ganesh is not available. Fake it. | 48 // Ganesh is not available. Fake it. |
| 48 | 49 |
| 49 enum GrGLStandard { | 50 enum GrGLStandard { |
| 50 kNone_GrGLStandard, | 51 kNone_GrGLStandard, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 static const GLContextType kANGLE_GLContextType = 0, | 70 static const GLContextType kANGLE_GLContextType = 0, |
| 70 kANGLE_GL_GLContextType = 0, | 71 kANGLE_GL_GLContextType = 0, |
| 71 kCommandBuffer_GLContextType = 0, | 72 kCommandBuffer_GLContextType = 0, |
| 72 kDebug_GLContextType = 0, | 73 kDebug_GLContextType = 0, |
| 73 kMESA_GLContextType = 0, | 74 kMESA_GLContextType = 0, |
| 74 kNVPR_GLContextType = 0, | 75 kNVPR_GLContextType = 0, |
| 75 kNative_GLContextType = 0, | 76 kNative_GLContextType = 0, |
| 76 kNull_GLContextType = 0; | 77 kNull_GLContextType = 0; |
| 77 static const int kGLContextTypeCnt = 1; | 78 static const int kGLContextTypeCnt = 1; |
| 79 enum GLContextOptions { |
| 80 kNone_GLContextOptions = 0, |
| 81 kEnableNVPR_GLContextOptions = 0x1, |
| 82 }; |
| 78 void destroyContexts() {} | 83 void destroyContexts() {} |
| 79 | 84 |
| 80 void abandonContexts() {} | 85 void abandonContexts() {} |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 namespace DM { | 88 namespace DM { |
| 84 | 89 |
| 85 static const bool kGPUDisabled = true; | 90 static const bool kGPUDisabled = true; |
| 86 | 91 |
| 87 static inline SkSurface* NewGpuSurface(GrContextFactory*, | 92 static inline SkSurface* NewGpuSurface(GrContextFactory*, |
| 88 GrContextFactory::GLContextType, | 93 GrContextFactory::GLContextType, |
| 94 GrContextFactory::GLContextOptions, |
| 89 GrGLStandard, | 95 GrGLStandard, |
| 90 SkImageInfo, | 96 SkImageInfo, |
| 91 int, | 97 int, |
| 92 bool) { | 98 bool) { |
| 93 return nullptr; | 99 return nullptr; |
| 94 } | 100 } |
| 95 | 101 |
| 96 } // namespace DM | 102 } // namespace DM |
| 97 | 103 |
| 98 #endif//SK_SUPPORT_GPU | 104 #endif//SK_SUPPORT_GPU |
| 99 | 105 |
| 100 #endif//DMGpuSupport_DEFINED | 106 #endif//DMGpuSupport_DEFINED |
| OLD | NEW |