Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Greg Daniel | 54bfb18 | 2018-11-20 17:12:36 -0500 | [diff] [blame] | 8 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 9 | #include "include/gpu/GrContext.h" |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/gpu/GrContextThreadSafeProxy.h" |
| 12 | #include "src/gpu/GrContextPriv.h" |
| 13 | #include "src/gpu/GrContextThreadSafeProxyPriv.h" |
| 14 | #include "src/gpu/GrGpu.h" |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 15 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 16 | #include "src/gpu/effects/GrSkSLFP.h" |
| 17 | #include "src/gpu/gl/GrGLGpu.h" |
| 18 | #include "src/gpu/mock/GrMockGpu.h" |
Robert Phillips | e19babf | 2020-04-06 13:57:30 -0400 | [diff] [blame] | 19 | #include "src/gpu/text/GrAtlasManager.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 20 | #include "src/gpu/text/GrStrikeCache.h" |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 21 | #ifdef SK_METAL |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 22 | #include "src/gpu/mtl/GrMtlTrampoline.h" |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 23 | #endif |
| 24 | #ifdef SK_VULKAN |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 25 | #include "src/gpu/vk/GrVkGpu.h" |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 26 | #endif |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 27 | #ifdef SK_DIRECT3D |
| 28 | #include "src/gpu/d3d/GrD3DGpu.h" |
| 29 | #endif |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 30 | #ifdef SK_DAWN |
Mike Klein | 52337de | 2019-07-25 09:00:52 -0500 | [diff] [blame] | 31 | #include "src/gpu/dawn/GrDawnGpu.h" |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 32 | #endif |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 33 | |
Robert Phillips | 6db27c2 | 2019-05-01 10:43:56 -0400 | [diff] [blame] | 34 | #ifdef SK_DISABLE_REDUCE_OPLIST_SPLITTING |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 35 | static const bool kDefaultReduceOpsTaskSplitting = false; |
Robert Phillips | 6db27c2 | 2019-05-01 10:43:56 -0400 | [diff] [blame] | 36 | #else |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 37 | static const bool kDefaultReduceOpsTaskSplitting = false; |
Robert Phillips | 6db27c2 | 2019-05-01 10:43:56 -0400 | [diff] [blame] | 38 | #endif |
| 39 | |
Brian Salomon | 57f211b | 2019-08-21 15:21:09 -0400 | [diff] [blame] | 40 | class GrLegacyDirectContext : public GrContext { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 41 | public: |
Robert Phillips | e834579 | 2019-02-07 10:48:24 -0500 | [diff] [blame] | 42 | GrLegacyDirectContext(GrBackendApi backend, const GrContextOptions& options) |
Robert Phillips | c1541ae | 2019-02-04 12:05:37 -0500 | [diff] [blame] | 43 | : INHERITED(backend, options) |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 44 | , fAtlasManager(nullptr) { |
| 45 | } |
| 46 | |
Robert Phillips | e834579 | 2019-02-07 10:48:24 -0500 | [diff] [blame] | 47 | ~GrLegacyDirectContext() override { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 48 | // this if-test protects against the case where the context is being destroyed |
| 49 | // before having been fully created |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 50 | if (this->priv().getGpu()) { |
Greg Daniel | 0a2464f | 2020-05-14 15:45:44 -0400 | [diff] [blame^] | 51 | this->flushAndSubmit(); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | delete fAtlasManager; |
| 55 | } |
| 56 | |
| 57 | void abandonContext() override { |
| 58 | INHERITED::abandonContext(); |
| 59 | fAtlasManager->freeAll(); |
| 60 | } |
| 61 | |
| 62 | void releaseResourcesAndAbandonContext() override { |
| 63 | INHERITED::releaseResourcesAndAbandonContext(); |
| 64 | fAtlasManager->freeAll(); |
| 65 | } |
| 66 | |
| 67 | void freeGpuResources() override { |
Greg Daniel | 0a2464f | 2020-05-14 15:45:44 -0400 | [diff] [blame^] | 68 | this->flushAndSubmit(); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 69 | fAtlasManager->freeAll(); |
| 70 | |
| 71 | INHERITED::freeGpuResources(); |
| 72 | } |
| 73 | |
| 74 | protected: |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 75 | bool init(sk_sp<const GrCaps> caps) override { |
| 76 | SkASSERT(caps); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 77 | SkASSERT(!fThreadSafeProxy); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 78 | |
Robert Phillips | bb60677 | 2019-02-04 17:50:57 -0500 | [diff] [blame] | 79 | fThreadSafeProxy = GrContextThreadSafeProxyPriv::Make(this->backend(), |
| 80 | this->options(), |
| 81 | this->contextID(), |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 82 | caps); |
Robert Phillips | bb60677 | 2019-02-04 17:50:57 -0500 | [diff] [blame] | 83 | |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 84 | if (!INHERITED::init(std::move(caps))) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 85 | return false; |
| 86 | } |
| 87 | |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 88 | bool reduceOpsTaskSplitting = kDefaultReduceOpsTaskSplitting; |
Greg Daniel | 9313874 | 2019-08-22 17:15:39 -0400 | [diff] [blame] | 89 | if (GrContextOptions::Enable::kNo == this->options().fReduceOpsTaskSplitting) { |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 90 | reduceOpsTaskSplitting = false; |
Greg Daniel | 9313874 | 2019-08-22 17:15:39 -0400 | [diff] [blame] | 91 | } else if (GrContextOptions::Enable::kYes == this->options().fReduceOpsTaskSplitting) { |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 92 | reduceOpsTaskSplitting = true; |
Robert Phillips | 6db27c2 | 2019-05-01 10:43:56 -0400 | [diff] [blame] | 93 | } |
| 94 | |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 95 | this->setupDrawingManager(true, reduceOpsTaskSplitting); |
Robert Phillips | 56181ba | 2019-03-08 12:00:45 -0500 | [diff] [blame] | 96 | |
Robert Phillips | bb60677 | 2019-02-04 17:50:57 -0500 | [diff] [blame] | 97 | SkASSERT(this->caps()); |
| 98 | |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 99 | GrDrawOpAtlas::AllowMultitexturing allowMultitexturing; |
Robert Phillips | c1541ae | 2019-02-04 12:05:37 -0500 | [diff] [blame] | 100 | if (GrContextOptions::Enable::kNo == this->options().fAllowMultipleGlyphCacheTextures || |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 101 | // multitexturing supported only if range can represent the index + texcoords fully |
Robert Phillips | bb60677 | 2019-02-04 17:50:57 -0500 | [diff] [blame] | 102 | !(this->caps()->shaderCaps()->floatIs32Bits() || |
| 103 | this->caps()->shaderCaps()->integerSupport())) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 104 | allowMultitexturing = GrDrawOpAtlas::AllowMultitexturing::kNo; |
| 105 | } else { |
| 106 | allowMultitexturing = GrDrawOpAtlas::AllowMultitexturing::kYes; |
| 107 | } |
| 108 | |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 109 | GrProxyProvider* proxyProvider = this->priv().proxyProvider(); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 110 | |
Robert Phillips | 207d24b | 2020-04-09 10:23:42 -0400 | [diff] [blame] | 111 | fAtlasManager = new GrAtlasManager(proxyProvider, |
Robert Phillips | c1541ae | 2019-02-04 12:05:37 -0500 | [diff] [blame] | 112 | this->options().fGlyphCacheTextureMaximumBytes, |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 113 | allowMultitexturing); |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 114 | this->priv().addOnFlushCallbackObject(fAtlasManager); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 115 | |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 116 | return true; |
| 117 | } |
| 118 | |
| 119 | GrAtlasManager* onGetAtlasManager() override { return fAtlasManager; } |
| 120 | |
| 121 | private: |
| 122 | GrAtlasManager* fAtlasManager; |
| 123 | |
| 124 | typedef GrContext INHERITED; |
| 125 | }; |
| 126 | |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 127 | #ifdef SK_GL |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 128 | sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> glInterface) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 129 | GrContextOptions defaultOptions; |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 130 | return MakeGL(std::move(glInterface), defaultOptions); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 131 | } |
| 132 | |
Brian Salomon | c1b9c10 | 2018-04-06 09:18:00 -0400 | [diff] [blame] | 133 | sk_sp<GrContext> GrContext::MakeGL(const GrContextOptions& options) { |
| 134 | return MakeGL(nullptr, options); |
| 135 | } |
| 136 | |
| 137 | sk_sp<GrContext> GrContext::MakeGL() { |
| 138 | GrContextOptions defaultOptions; |
| 139 | return MakeGL(nullptr, defaultOptions); |
| 140 | } |
| 141 | |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 142 | sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> glInterface, |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 143 | const GrContextOptions& options) { |
Robert Phillips | e834579 | 2019-02-07 10:48:24 -0500 | [diff] [blame] | 144 | sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kOpenGL, options)); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 145 | |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 146 | context->fGpu = GrGLGpu::Make(std::move(glInterface), options, context.get()); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 147 | if (!context->fGpu) { |
| 148 | return nullptr; |
| 149 | } |
| 150 | |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 151 | if (!context->init(context->fGpu->refCaps())) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 152 | return nullptr; |
| 153 | } |
| 154 | return context; |
| 155 | } |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 156 | #endif |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 157 | |
| 158 | sk_sp<GrContext> GrContext::MakeMock(const GrMockOptions* mockOptions) { |
| 159 | GrContextOptions defaultOptions; |
| 160 | return MakeMock(mockOptions, defaultOptions); |
| 161 | } |
| 162 | |
| 163 | sk_sp<GrContext> GrContext::MakeMock(const GrMockOptions* mockOptions, |
| 164 | const GrContextOptions& options) { |
Robert Phillips | e834579 | 2019-02-07 10:48:24 -0500 | [diff] [blame] | 165 | sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kMock, options)); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 166 | |
| 167 | context->fGpu = GrMockGpu::Make(mockOptions, options, context.get()); |
| 168 | if (!context->fGpu) { |
| 169 | return nullptr; |
| 170 | } |
| 171 | |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 172 | if (!context->init(context->fGpu->refCaps())) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 173 | return nullptr; |
| 174 | } |
Chris Dalton | a378b45 | 2019-12-11 13:24:11 -0500 | [diff] [blame] | 175 | |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 176 | return context; |
| 177 | } |
| 178 | |
Mike Klein | a55e214 | 2018-10-03 16:34:11 +0000 | [diff] [blame] | 179 | sk_sp<GrContext> GrContext::MakeVulkan(const GrVkBackendContext& backendContext) { |
Greg Daniel | b4d8956 | 2018-10-03 18:44:49 +0000 | [diff] [blame] | 180 | #ifdef SK_VULKAN |
Greg Daniel | 10a83da | 2018-06-14 09:31:11 -0400 | [diff] [blame] | 181 | GrContextOptions defaultOptions; |
| 182 | return MakeVulkan(backendContext, defaultOptions); |
Greg Daniel | b4d8956 | 2018-10-03 18:44:49 +0000 | [diff] [blame] | 183 | #else |
| 184 | return nullptr; |
| 185 | #endif |
Greg Daniel | 10a83da | 2018-06-14 09:31:11 -0400 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | sk_sp<GrContext> GrContext::MakeVulkan(const GrVkBackendContext& backendContext, |
| 189 | const GrContextOptions& options) { |
Greg Daniel | b4d8956 | 2018-10-03 18:44:49 +0000 | [diff] [blame] | 190 | #ifdef SK_VULKAN |
Robert Phillips | e834579 | 2019-02-07 10:48:24 -0500 | [diff] [blame] | 191 | sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kVulkan, options)); |
Greg Daniel | 10a83da | 2018-06-14 09:31:11 -0400 | [diff] [blame] | 192 | |
Greg Daniel | f730c18 | 2018-07-02 20:15:37 +0000 | [diff] [blame] | 193 | context->fGpu = GrVkGpu::Make(backendContext, options, context.get()); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 194 | if (!context->fGpu) { |
| 195 | return nullptr; |
| 196 | } |
| 197 | |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 198 | if (!context->init(context->fGpu->refCaps())) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 199 | return nullptr; |
| 200 | } |
| 201 | return context; |
Greg Daniel | b4d8956 | 2018-10-03 18:44:49 +0000 | [diff] [blame] | 202 | #else |
| 203 | return nullptr; |
Mike Klein | a55e214 | 2018-10-03 16:34:11 +0000 | [diff] [blame] | 204 | #endif |
Greg Daniel | b4d8956 | 2018-10-03 18:44:49 +0000 | [diff] [blame] | 205 | } |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 206 | |
| 207 | #ifdef SK_METAL |
| 208 | sk_sp<GrContext> GrContext::MakeMetal(void* device, void* queue) { |
| 209 | GrContextOptions defaultOptions; |
| 210 | return MakeMetal(device, queue, defaultOptions); |
| 211 | } |
| 212 | |
| 213 | sk_sp<GrContext> GrContext::MakeMetal(void* device, void* queue, const GrContextOptions& options) { |
Robert Phillips | e834579 | 2019-02-07 10:48:24 -0500 | [diff] [blame] | 214 | sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kMetal, options)); |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 215 | |
| 216 | context->fGpu = GrMtlTrampoline::MakeGpu(context.get(), options, device, queue); |
| 217 | if (!context->fGpu) { |
| 218 | return nullptr; |
| 219 | } |
Timothy Liang | 4e85e80 | 2018-06-28 16:37:18 -0400 | [diff] [blame] | 220 | |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 221 | if (!context->init(context->fGpu->refCaps())) { |
Robert Phillips | a3457b8 | 2018-03-08 11:30:12 -0500 | [diff] [blame] | 222 | return nullptr; |
| 223 | } |
| 224 | return context; |
| 225 | } |
| 226 | #endif |
| 227 | |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 228 | #ifdef SK_DIRECT3D |
| 229 | sk_sp<GrContext> GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext) { |
| 230 | GrContextOptions defaultOptions; |
| 231 | return MakeDirect3D(backendContext, defaultOptions); |
| 232 | } |
| 233 | |
| 234 | sk_sp<GrContext> GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext, |
| 235 | const GrContextOptions& options) { |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 236 | sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kDirect3D, options)); |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 237 | |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 238 | context->fGpu = GrD3DGpu::Make(backendContext, options, context.get()); |
| 239 | if (!context->fGpu) { |
| 240 | return nullptr; |
| 241 | } |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 242 | |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 243 | if (!context->init(context->fGpu->refCaps())) { |
| 244 | return nullptr; |
| 245 | } |
| 246 | return context; |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 247 | } |
| 248 | #endif |
| 249 | |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 250 | #ifdef SK_DAWN |
Stephen White | a521c96 | 2019-12-04 09:57:48 -0500 | [diff] [blame] | 251 | sk_sp<GrContext> GrContext::MakeDawn(const wgpu::Device& device) { |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 252 | GrContextOptions defaultOptions; |
| 253 | return MakeDawn(device, defaultOptions); |
| 254 | } |
| 255 | |
Stephen White | a521c96 | 2019-12-04 09:57:48 -0500 | [diff] [blame] | 256 | sk_sp<GrContext> GrContext::MakeDawn(const wgpu::Device& device, const GrContextOptions& options) { |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 257 | sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kDawn, options)); |
| 258 | |
| 259 | context->fGpu = GrDawnGpu::Make(device, options, context.get()); |
| 260 | if (!context->fGpu) { |
| 261 | return nullptr; |
| 262 | } |
| 263 | |
Brian Osman | 7b1678a | 2019-12-16 09:17:25 -0500 | [diff] [blame] | 264 | if (!context->init(context->fGpu->refCaps())) { |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 265 | return nullptr; |
| 266 | } |
| 267 | return context; |
| 268 | } |
| 269 | #endif |