• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // PBufferSurfaceWGL.h: WGL implementation of egl::Surface for PBuffers
8 
9 #ifndef LIBANGLE_RENDERER_GL_WGL_PBUFFERSURFACEWGL_H_
10 #define LIBANGLE_RENDERER_GL_WGL_PBUFFERSURFACEWGL_H_
11 
12 #include "libANGLE/renderer/gl/wgl/SurfaceWGL.h"
13 
14 #include <GL/wglext.h>
15 
16 namespace rx
17 {
18 
19 class FunctionsWGL;
20 
21 class PbufferSurfaceWGL : public SurfaceWGL
22 {
23   public:
24     PbufferSurfaceWGL(const egl::SurfaceState &state,
25                       EGLint width,
26                       EGLint height,
27                       EGLenum textureFormat,
28                       EGLenum textureTarget,
29                       bool largest,
30                       int pixelFormat,
31                       HDC deviceContext,
32                       const FunctionsWGL *functions);
33     ~PbufferSurfaceWGL() override;
34 
35     egl::Error initialize(const egl::Display *display) override;
36     egl::Error makeCurrent(const gl::Context *context) override;
37 
38     egl::Error swap(const gl::Context *context) override;
39     egl::Error postSubBuffer(const gl::Context *context,
40                              EGLint x,
41                              EGLint y,
42                              EGLint width,
43                              EGLint height) override;
44     egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
45     egl::Error bindTexImage(const gl::Context *context,
46                             gl::Texture *texture,
47                             EGLint buffer) override;
48     egl::Error releaseTexImage(const gl::Context *context, EGLint buffer) override;
49     void setSwapInterval(EGLint interval) override;
50 
51     EGLint getWidth() const override;
52     EGLint getHeight() const override;
53 
54     EGLint isPostSubBufferSupported() const override;
55     EGLint getSwapBehavior() const override;
56 
57     HDC getDC() const override;
58 
59   private:
60     EGLint mWidth;
61     EGLint mHeight;
62     bool mLargest;
63     EGLenum mTextureFormat;
64     EGLenum mTextureTarget;
65 
66     int mPixelFormat;
67 
68     HDC mParentDeviceContext;
69 
70     HPBUFFERARB mPbuffer;
71     HDC mPbufferDeviceContext;
72 
73     const FunctionsWGL *mFunctionsWGL;
74 };
75 
76 }  // namespace rx
77 
78 #endif  // LIBANGLE_RENDERER_GL_WGL_PBUFFERSURFACEWGL_H_
79