1 // 2 // Copyright 2020 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 // PixmapSurfaceGLX.h: GLX implementation of egl::Surface for Pixmaps 8 9 #ifndef LIBANGLE_RENDERER_GL_GLX_PIXMAPSURFACEGLX_H_ 10 #define LIBANGLE_RENDERER_GL_GLX_PIXMAPSURFACEGLX_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 PixmapSurfaceGLX : public SurfaceGLX 21 { 22 public: 23 PixmapSurfaceGLX(const egl::SurfaceState &state, 24 Pixmap pixmap, 25 Display *display, 26 const FunctionsGLX &glx, 27 glx::FBConfig fbConfig); 28 ~PixmapSurfaceGLX() override; 29 30 egl::Error initialize(const egl::Display *display) override; 31 egl::Error makeCurrent(const gl::Context *context) override; 32 33 egl::Error swap(const gl::Context *context) override; 34 egl::Error postSubBuffer(const gl::Context *context, 35 EGLint x, 36 EGLint y, 37 EGLint width, 38 EGLint height) override; 39 egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; 40 egl::Error bindTexImage(const gl::Context *context, 41 gl::Texture *texture, 42 EGLint buffer) override; 43 egl::Error releaseTexImage(const gl::Context *context, EGLint buffer) override; 44 void setSwapInterval(EGLint interval) override; 45 46 EGLint getWidth() const override; 47 EGLint getHeight() const override; 48 49 EGLint isPostSubBufferSupported() const override; 50 EGLint getSwapBehavior() const override; 51 52 egl::Error checkForResize() override; 53 glx::Drawable getDrawable() const override; 54 55 private: 56 unsigned mWidth; 57 unsigned mHeight; 58 59 const FunctionsGLX &mGLX; 60 glx::FBConfig mFBConfig; 61 Pixmap mXPixmap; 62 glx::Pixmap mGLXPixmap; 63 Display *mDisplay; 64 }; 65 66 } // namespace rx 67 68 #endif // LIBANGLE_RENDERER_GL_GLX_PIXMAPSURFACEGLX_H_ 69