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::GLContextType type, | 33 sk_gpu_test::GrContextFactory::ContextType type, |
34 sk_gpu_test::GrContextFactory::GLContextOptions options, | 34 sk_gpu_test::GrContextFactory::ContextOptions 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 GLContextType; | 69 typedef int ContextType; |
70 | 70 |
71 static const GLContextType kANGLE_GLContextType = 0, | 71 static const ContextType kANGLE_ContextType = 0, |
72 kANGLE_GL_GLContextType = 0, | 72 kANGLE_GL_ContextType = 0, |
73 kCommandBuffer_GLContextType = 0, | 73 kCommandBuffer_ContextType = 0, |
74 kDebug_GLContextType = 0, | 74 kDebugGL_ContextType = 0, |
75 kMESA_GLContextType = 0, | 75 kMESA_ContextType = 0, |
76 kNVPR_GLContextType = 0, | 76 kNVPR_ContextType = 0, |
77 kNative_GLContextType = 0, | 77 kNativeGL_ContextType = 0, |
78 kNull_GLContextType = 0; | 78 kGL_ContextType = 0, |
79 static const int kGLContextTypeCnt = 1; | 79 kGLES_ContextType = 0, |
80 enum GLContextOptions { | 80 kNullGL_ContextType = 0; |
81 kNone_GLContextOptions = 0, | 81 static const int kContextTypeCnt = 1; |
82 kEnableNVPR_GLContextOptions = 0x1, | 82 enum ContextOptions { |
| 83 kNone_ContextOptions = 0, |
| 84 kEnableNVPR_ContextOptions = 0x1, |
83 }; | 85 }; |
84 void destroyContexts() {} | 86 void destroyContexts() {} |
85 | 87 |
86 void abandonContexts() {} | 88 void abandonContexts() {} |
87 | 89 |
88 void releaseResourcesAndAbandonContexts() {} | 90 void releaseResourcesAndAbandonContexts() {} |
89 }; | 91 }; |
90 } // namespace sk_gpu_test | 92 } // namespace sk_gpu_test |
91 | 93 |
92 namespace DM { | 94 namespace DM { |
93 | 95 |
94 static const bool kGPUDisabled = true; | 96 static const bool kGPUDisabled = true; |
95 | 97 |
96 static inline SkSurface* NewGpuSurface(sk_gpu_test::GrContextFactory*, | 98 static inline SkSurface* NewGpuSurface(sk_gpu_test::GrContextFactory*, |
97 sk_gpu_test::GrContextFactory::GLContextT
ype, | 99 sk_gpu_test::GrContextFactory::ContextTyp
e, |
98 sk_gpu_test::GrContextFactory::GLContextO
ptions, | 100 sk_gpu_test::GrContextFactory::ContextOpt
ions, |
99 SkImageInfo, | 101 SkImageInfo, |
100 int, | 102 int, |
101 bool) { | 103 bool) { |
102 return nullptr; | 104 return nullptr; |
103 } | 105 } |
104 | 106 |
105 } // namespace DM | 107 } // namespace DM |
106 | 108 |
107 #endif//SK_SUPPORT_GPU | 109 #endif//SK_SUPPORT_GPU |
108 | 110 |
109 #endif//DMGpuSupport_DEFINED | 111 #endif//DMGpuSupport_DEFINED |
OLD | NEW |