1 // 2 // Copyright 2015 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 7 // PBufferSurfaceGLX.h: GLX implementation of egl::Surface for PBuffers 8 9 #ifndef LIBANGLE_RENDERER_GL_GLX_PBUFFERSURFACEGLX_H_ 10 #define LIBANGLE_RENDERER_GL_GLX_PBUFFERSURFACEGLX_H_ 11 12 #include "libANGLE/renderer/gl/glx/SurfaceGLX.h" 13 #include "libANGLE/renderer/gl/glx/platform_glx.h" 14 15 namespace rx 16 { 17 18 class FunctionsGLX; 19 20 class PbufferSurfaceGLX : public SurfaceGLX 21 { 22 public: 23 PbufferSurfaceGLX(const egl::SurfaceState &state, 24 EGLint width, 25 EGLint height, 26 bool largest, 27 const FunctionsGLX &glx, 28 glx::FBConfig fbConfig); 29 ~PbufferSurfaceGLX() override; 30 31 egl::Error initialize(const egl::Display *display) override; 32 egl::Error makeCurrent(const gl::Context *context) override; 33 34 egl::Error swap(const gl::Context *context) override; 35 egl::Error postSubBuffer(const gl::Context *context, 36 EGLint x, 37 EGLint y, 38 EGLint width, 39 EGLint height) override; 40 egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; 41 egl::Error bindTexImage(const gl::Context *context, 42 gl::Texture *texture, 43 EGLint buffer) override; 44 egl::Error releaseTexImage(const gl::Context *context, EGLint buffer) override; 45 void setSwapInterval(EGLint interval) override; 46 47 EGLint getWidth() const override; 48 EGLint getHeight() const override; 49 50 EGLint isPostSubBufferSupported() const override; 51 EGLint getSwapBehavior() const override; 52 53 egl::Error checkForResize() override; 54 glx::Drawable getDrawable() const override; 55 56 private: 57 unsigned mWidth; 58 unsigned mHeight; 59 bool mLargest; 60 61 const FunctionsGLX &mGLX; 62 glx::FBConfig mFBConfig; 63 glx::Pbuffer mPbuffer; 64 }; 65 66 } // namespace rx 67 68 #endif // LIBANGLE_RENDERER_GL_GLX_PBUFFERSURFACEGLX_H_ 69