Remove OpenGLBinding's dependency on glad

This move all the OpenGL-specific code for swapchain handling in a new
NativeSwapChainImpl in the OpenGL backend so no code outside of
dawn_native needs OpenGL.

BUG=dawn:165

Change-Id: I3c0c1055e3215a59fdc8e9550baf30762a7014b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8161
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2019-06-17 09:01:09 +00:00
committed by Commit Bot service account
parent 21eba761b5
commit abdb566c30
6 changed files with 180 additions and 73 deletions

View File

@@ -15,6 +15,7 @@
#ifndef DAWNNATIVE_OPENGLBACKEND_H_
#define DAWNNATIVE_OPENGLBACKEND_H_
#include <dawn/dawn_wsi.h>
#include <dawn_native/DawnNative.h>
namespace dawn_native { namespace opengl {
@@ -25,6 +26,12 @@ namespace dawn_native { namespace opengl {
void* (*getProc)(const char*);
};
using PresentCallback = void (*)(void*);
DAWN_NATIVE_EXPORT DawnSwapChainImplementation
CreateNativeSwapChainImpl(DawnDevice device, PresentCallback present, void* presentUserdata);
DAWN_NATIVE_EXPORT DawnTextureFormat
GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain);
}} // namespace dawn_native::opengl
#endif // DAWNNATIVE_OPENGLBACKEND_H_