1 // Copyright 2018 The Dawn Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef DAWNNATIVE_OPENGLBACKEND_H_ 16 #define DAWNNATIVE_OPENGLBACKEND_H_ 17 18 typedef void* EGLImage; 19 20 #include <dawn/dawn_wsi.h> 21 #include <dawn_native/DawnNative.h> 22 23 namespace dawn_native { namespace opengl { 24 25 struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptions : public AdapterDiscoveryOptionsBase { 26 AdapterDiscoveryOptions(); 27 28 void* (*getProc)(const char*); 29 }; 30 31 struct DAWN_NATIVE_EXPORT AdapterDiscoveryOptionsES : public AdapterDiscoveryOptionsBase { 32 AdapterDiscoveryOptionsES(); 33 34 void* (*getProc)(const char*); 35 }; 36 37 using PresentCallback = void (*)(void*); 38 DAWN_NATIVE_EXPORT DawnSwapChainImplementation 39 CreateNativeSwapChainImpl(WGPUDevice device, PresentCallback present, void* presentUserdata); 40 DAWN_NATIVE_EXPORT WGPUTextureFormat 41 GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain); 42 43 struct DAWN_NATIVE_EXPORT ExternalImageDescriptorEGLImage : ExternalImageDescriptor { 44 public: 45 ExternalImageDescriptorEGLImage(); 46 47 ::EGLImage image; 48 }; 49 50 DAWN_NATIVE_EXPORT WGPUTexture 51 WrapExternalEGLImage(WGPUDevice device, const ExternalImageDescriptorEGLImage* descriptor); 52 53 }} // namespace dawn_native::opengl 54 55 #endif // DAWNNATIVE_OPENGLBACKEND_H_ 56