~mmach/netext73/webkit2gtk

« back to all changes in this revision

Viewing changes to Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/eagl/PbufferSurfaceEAGL.h

  • Committer: mmach
  • Date: 2023-06-16 17:21:37 UTC
  • Revision ID: netbit73@gmail.com-20230616172137-2rqx6yr96ga9g3kp
1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
// PBufferSurfaceEAGL.h: an implementation of egl::Surface for PBuffers for the EAGL backend,
 
8
//                       currently implemented using renderbuffers
 
9
 
 
10
#ifndef LIBANGLE_RENDERER_GL_EAGL_PBUFFERSURFACEEAGL_H_
 
11
#define LIBANGLE_RENDERER_GL_EAGL_PBUFFERSURFACEEAGL_H_
 
12
 
 
13
#include "libANGLE/renderer/gl/SurfaceGL.h"
 
14
 
 
15
namespace rx
 
16
{
 
17
 
 
18
class FunctionsGL;
 
19
class RendererGL;
 
20
class StateManagerGL;
 
21
 
 
22
class PbufferSurfaceEAGL : public SurfaceGL
 
23
{
 
24
  public:
 
25
    PbufferSurfaceEAGL(const egl::SurfaceState &state,
 
26
                       RendererGL *renderer,
 
27
                       EGLint width,
 
28
                       EGLint height);
 
29
    ~PbufferSurfaceEAGL() 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
    FramebufferImpl *createDefaultFramebuffer(const gl::Context *context,
 
54
                                              const gl::FramebufferState &state) override;
 
55
 
 
56
  private:
 
57
    unsigned mWidth;
 
58
    unsigned mHeight;
 
59
 
 
60
    // TODO(geofflang): Don't store these, they are potentially specific to a single GL context.
 
61
    // http://anglebug.com/2464
 
62
    const FunctionsGL *mFunctions;
 
63
    StateManagerGL *mStateManager;
 
64
 
 
65
    GLuint mColorRenderbuffer;
 
66
    GLuint mDSRenderbuffer;
 
67
};
 
68
 
 
69
}  // namespace rx
 
70
 
 
71
#endif  // LIBANGLE_RENDERER_GL_EAGL_PBUFFERSURFACEEAGL_H_