| 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 13 matching lines...) Expand all Loading... |
| 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 GrContextFactory::GLContextOptions option
s, |
| 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, options), SkSurface::
kNo_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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void abandonContexts() {} | 85 void abandonContexts() {} |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 namespace DM { | 88 namespace DM { |
| 88 | 89 |
| 89 static const bool kGPUDisabled = true; | 90 static const bool kGPUDisabled = true; |
| 90 | 91 |
| 91 static inline SkSurface* NewGpuSurface(GrContextFactory*, | 92 static inline SkSurface* NewGpuSurface(GrContextFactory*, |
| 92 GrContextFactory::GLContextType, | 93 GrContextFactory::GLContextType, |
| 93 GrContextFactory::GLContextOptions, | 94 GrContextFactory::GLContextOptions, |
| 95 GrGLStandard, |
| 94 SkImageInfo, | 96 SkImageInfo, |
| 95 int, | 97 int, |
| 96 bool) { | 98 bool) { |
| 97 return nullptr; | 99 return nullptr; |
| 98 } | 100 } |
| 99 | 101 |
| 100 } // namespace DM | 102 } // namespace DM |
| 101 | 103 |
| 102 #endif//SK_SUPPORT_GPU | 104 #endif//SK_SUPPORT_GPU |
| 103 | 105 |
| 104 #endif//DMGpuSupport_DEFINED | 106 #endif//DMGpuSupport_DEFINED |
| OLD | NEW |