Changeset View
Changeset View
Standalone View
Standalone View
platformsupport/scenes/opengl/abstract_egl_backend.h
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
80 | private: | 80 | private: | ||
81 | void unbindWaylandDisplay(); | 81 | void unbindWaylandDisplay(); | ||
82 | 82 | | |||
83 | EGLDisplay m_display = EGL_NO_DISPLAY; | 83 | EGLDisplay m_display = EGL_NO_DISPLAY; | ||
84 | EGLSurface m_surface = EGL_NO_SURFACE; | 84 | EGLSurface m_surface = EGL_NO_SURFACE; | ||
85 | EGLContext m_context = EGL_NO_CONTEXT; | 85 | EGLContext m_context = EGL_NO_CONTEXT; | ||
86 | EGLConfig m_config = nullptr; | 86 | EGLConfig m_config = nullptr; | ||
87 | QList<QByteArray> m_clientExtensions; | 87 | QList<QByteArray> m_clientExtensions; | ||
88 | }; | 88 | }; | ||
romangg: Why QLinkedList? It should be no better than QList for the removeOne call. For this better use… | |||||
I believe the use of QList is discouraged in new code, but you are right about QSet being a better choice in this case. fredrik: I believe the use of QList is discouraged in new code, but you are right about QSet being a… | |||||
89 | 89 | | |||
90 | class KWIN_EXPORT AbstractEglTexture : public SceneOpenGLTexturePrivate | 90 | class KWIN_EXPORT AbstractEglTexture : public SceneOpenGLTexturePrivate | ||
91 | { | 91 | { | ||
92 | public: | 92 | public: | ||
93 | virtual ~AbstractEglTexture(); | 93 | virtual ~AbstractEglTexture(); | ||
94 | bool loadTexture(WindowPixmap *pixmap) override; | 94 | bool loadTexture(WindowPixmap *pixmap) override; | ||
95 | void updateTexture(WindowPixmap *pixmap) override; | 95 | void updateTexture(WindowPixmap *pixmap) override; | ||
96 | OpenGLBackend *backend() override; | 96 | OpenGLBackend *backend() override; | ||
97 | 97 | | |||
98 | protected: | 98 | protected: | ||
99 | AbstractEglTexture(SceneOpenGLTexture *texture, AbstractEglBackend *backend); | 99 | AbstractEglTexture(SceneOpenGLTexture *texture, AbstractEglBackend *backend); | ||
100 | EGLImageKHR image() const { | 100 | EGLImageKHR image() const { | ||
101 | return m_image; | 101 | return m_image; | ||
102 | } | 102 | } | ||
103 | void setImage(const EGLImageKHR &img) { | 103 | void setImage(const EGLImageKHR &img) { | ||
104 | m_image = img; | 104 | m_image = img; | ||
105 | } | 105 | } | ||
106 | SceneOpenGLTexture *texture() const { | 106 | SceneOpenGLTexture *texture() const { | ||
107 | return q; | 107 | return q; | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | private: | 110 | private: | ||
111 | bool loadShmTexture(const QPointer<KWayland::Server::BufferInterface> &buffer); | 111 | bool loadShmTexture(const QPointer<KWayland::Server::BufferInterface> &buffer); | ||
112 | bool loadEglTexture(const QPointer<KWayland::Server::BufferInterface> &buffer); | 112 | bool loadEglTexture(const QPointer<KWayland::Server::BufferInterface> &buffer); | ||
113 | bool loadDmabufTexture(const QPointer< KWayland::Server::BufferInterface > &buffer); | ||||
113 | EGLImageKHR attach(const QPointer<KWayland::Server::BufferInterface> &buffer); | 114 | EGLImageKHR attach(const QPointer<KWayland::Server::BufferInterface> &buffer); | ||
114 | bool updateFromFBO(const QSharedPointer<QOpenGLFramebufferObject> &fbo); | 115 | bool updateFromFBO(const QSharedPointer<QOpenGLFramebufferObject> &fbo); | ||
115 | SceneOpenGLTexture *q; | 116 | SceneOpenGLTexture *q; | ||
116 | AbstractEglBackend *m_backend; | 117 | AbstractEglBackend *m_backend; | ||
117 | EGLImageKHR m_image; | 118 | EGLImageKHR m_image; | ||
118 | }; | 119 | }; | ||
119 | 120 | | |||
120 | } | 121 | } | ||
romangg: Why is it necessary to export? | |||||
I guess it isn't. I was thinking at the time that someone might want to use this class in a class derived from AbstractEglBackend or AbstractEglTexture. fredrik: I guess it isn't. I was thinking at the time that someone might want to use this class in a… | |||||
121 | 122 | | |||
122 | #endif | 123 | #endif |
Why QLinkedList? It should be no better than QList for the removeOne call. For this better use QSet.