| 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 sk_sp<SkSurface> NewGpuSurface( | 31 static inline sk_sp<SkSurface> NewGpuSurface( |
| 32 sk_gpu_test::GrContextFactory* grFactory, | 32 sk_gpu_test::GrContextFactory* grFactory, |
| 33 sk_gpu_test::GrContextFactory::ContextType type, | 33 sk_gpu_test::GrContextFactory::GLContextType type, |
| 34 sk_gpu_test::GrContextFactory::ContextOptions options, | 34 sk_gpu_test::GrContextFactory::GLContextOptions options, |
| 35 SkImageInfo info, | 35 SkImageInfo info, |
| 36 int samples, | 36 int samples, |
| 37 bool useDIText) { | 37 bool useDIText) { |
| 38 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag
: 0; | 38 uint32_t flags = useDIText ? SkSurfaceProps::kUseDeviceIndependentFonts_Flag
: 0; |
| 39 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 39 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
| 40 return SkSurface::MakeRenderTarget(grFactory->get(type, options), SkBudgeted
::kNo, | 40 return SkSurface::MakeRenderTarget(grFactory->get(type, options), SkBudgeted
::kNo, |
| 41 info, samples, &props); | 41 info, samples, &props); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace DM | 44 } // namespace DM |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 void dumpCacheStats(SkString*) const {} | 59 void dumpCacheStats(SkString*) const {} |
| 60 void dumpGpuStats(SkString*) const {} | 60 void dumpGpuStats(SkString*) const {} |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 namespace sk_gpu_test { | 63 namespace sk_gpu_test { |
| 64 class GrContextFactory { | 64 class GrContextFactory { |
| 65 public: | 65 public: |
| 66 GrContextFactory() {}; | 66 GrContextFactory() {}; |
| 67 explicit GrContextFactory(const GrContextOptions&) {} | 67 explicit GrContextFactory(const GrContextOptions&) {} |
| 68 | 68 |
| 69 typedef int ContextType; | 69 typedef int GLContextType; |
| 70 | 70 |
| 71 static const ContextType kANGLE_ContextType = 0, | 71 static const GLContextType kANGLE_GLContextType = 0, |
| 72 kANGLE_GL_ContextType = 0, | 72 kANGLE_GL_GLContextType = 0, |
| 73 kCommandBuffer_ContextType = 0, | 73 kCommandBuffer_GLContextType = 0, |
| 74 kDebugGL_ContextType = 0, | 74 kDebug_GLContextType = 0, |
| 75 kMESA_ContextType = 0, | 75 kMESA_GLContextType = 0, |
| 76 kNVPR_ContextType = 0, | 76 kNVPR_GLContextType = 0, |
| 77 kNativeGL_ContextType = 0, | 77 kNative_GLContextType = 0, |
| 78 kGL_ContextType = 0, | 78 kNull_GLContextType = 0; |
| 79 kGLES_ContextType = 0, | 79 static const int kGLContextTypeCnt = 1; |
| 80 kNullGL_ContextType = 0; | 80 enum GLContextOptions { |
| 81 static const int kContextTypeCnt = 1; | 81 kNone_GLContextOptions = 0, |
| 82 enum ContextOptions { | 82 kEnableNVPR_GLContextOptions = 0x1, |
| 83 kNone_ContextOptions = 0, | |
| 84 kEnableNVPR_ContextOptions = 0x1, | |
| 85 }; | 83 }; |
| 86 void destroyContexts() {} | 84 void destroyContexts() {} |
| 87 | 85 |
| 88 void abandonContexts() {} | 86 void abandonContexts() {} |
| 89 | 87 |
| 90 void releaseResourcesAndAbandonContexts() {} | 88 void releaseResourcesAndAbandonContexts() {} |
| 91 }; | 89 }; |
| 92 } // namespace sk_gpu_test | 90 } // namespace sk_gpu_test |
| 93 | 91 |
| 94 namespace DM { | 92 namespace DM { |
| 95 | 93 |
| 96 static const bool kGPUDisabled = true; | 94 static const bool kGPUDisabled = true; |
| 97 | 95 |
| 98 static inline SkSurface* NewGpuSurface(sk_gpu_test::GrContextFactory*, | 96 static inline SkSurface* NewGpuSurface(sk_gpu_test::GrContextFactory*, |
| 99 sk_gpu_test::GrContextFactory::ContextTyp
e, | 97 sk_gpu_test::GrContextFactory::GLContextT
ype, |
| 100 sk_gpu_test::GrContextFactory::ContextOpt
ions, | 98 sk_gpu_test::GrContextFactory::GLContextO
ptions, |
| 101 SkImageInfo, | 99 SkImageInfo, |
| 102 int, | 100 int, |
| 103 bool) { | 101 bool) { |
| 104 return nullptr; | 102 return nullptr; |
| 105 } | 103 } |
| 106 | 104 |
| 107 } // namespace DM | 105 } // namespace DM |
| 108 | 106 |
| 109 #endif//SK_SUPPORT_GPU | 107 #endif//SK_SUPPORT_GPU |
| 110 | 108 |
| 111 #endif//DMGpuSupport_DEFINED | 109 #endif//DMGpuSupport_DEFINED |
| OLD | NEW |