capture_egl.h (2277B)
1 // 2 // Copyright 2022 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // capture_egl.h: 7 // EGL capture functions 8 // 9 10 #ifndef LIBANGLE_CAPTURE_EGL_H_ 11 #define LIBANGLE_CAPTURE_EGL_H_ 12 13 #include "libANGLE/Context.h" 14 #include "libANGLE/Thread.h" 15 #include "libANGLE/capture/FrameCapture.h" 16 17 namespace gl 18 { 19 enum class GLenumGroup; 20 } 21 22 namespace egl 23 { 24 25 template <typename CaptureFuncT, typename... ArgsT> 26 void CaptureCallToCaptureEGL(CaptureFuncT captureFunc, egl::Thread *thread, ArgsT... captureParams) 27 { 28 gl::Context *context = thread->getContext(); 29 if (!context) 30 { 31 return; 32 } 33 34 angle::FrameCaptureShared *frameCaptureShared = 35 context->getShareGroup()->getFrameCaptureShared(); 36 if (!frameCaptureShared->isCapturing()) 37 { 38 return; 39 } 40 41 angle::CallCapture call = captureFunc(captureParams...); 42 43 frameCaptureShared->captureCall(context, std::move(call), true); 44 } 45 46 angle::CallCapture CaptureCreateNativeClientBufferANDROID(const egl::AttributeMap &attribMap, 47 EGLClientBuffer eglClientBuffer); 48 angle::CallCapture CaptureEGLCreateImage(const gl::Context *context, 49 EGLenum target, 50 EGLClientBuffer buffer, 51 const egl::AttributeMap &attributes, 52 egl::Image *image); 53 angle::CallCapture CaptureEGLDestroyImage(egl::Display *display, egl::Image *image); 54 55 angle::CallCapture CaptureEGLCreatePbufferSurface(const AttributeMap &attrib_list, 56 egl::Surface *surface); 57 58 angle::CallCapture CaptureEGLDestroySurface(Display *display, Surface *surface); 59 60 angle::CallCapture CaptureEGLBindTexImage(egl::Surface *surface, EGLint buffer); 61 62 angle::CallCapture CaptureEGLReleaseTexImage(egl::Surface *surface, EGLint buffer); 63 64 angle::CallCapture CaptureEGLMakeCurrent(Surface *drawSurface, 65 Surface *readSurface, 66 gl::Context *context); 67 } // namespace egl 68 69 #endif // LIBANGLE_FRAME_CAPTURE_H_