diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-01-06 12:26:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-06 13:12:32 +0100 |
commit | cd1e9d036ff1354c65b016ba8af0d6d6bd7cea92 (patch) | |
tree | fc7ff2a2fc5c3f2862b3c0e46589fc44ee1f1a9f /src/compositor/hardware_integration | |
parent | b2bfcec54cb46fa9e6555d3cb77ae6b995392ac6 (diff) |
Revised createTextureFromBuffer
The context is not passed anymore to texture() and similar functions since
they have to use the current context anyhow.
createTextureFromBuffer() becomes bindTextureToBuffer() which is called
with the texture bound. The integration can also provide its own texture in
case the one created and managed by the surfacebuffer is not suitable.
Change-Id: I1bfc4fe35c0e3db6081b47c551f20f4bca9aa04e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/compositor/hardware_integration')
-rw-r--r-- | src/compositor/hardware_integration/qwaylandclientbufferintegration.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compositor/hardware_integration/qwaylandclientbufferintegration.h b/src/compositor/hardware_integration/qwaylandclientbufferintegration.h index 6451f6156..b3f305001 100644 --- a/src/compositor/hardware_integration/qwaylandclientbufferintegration.h +++ b/src/compositor/hardware_integration/qwaylandclientbufferintegration.h @@ -63,10 +63,14 @@ public: virtual void initializeHardware(QtWayland::Display *waylandDisplay) = 0; - /** Bind the Wayland buffer to the textureId. The correct context is the current context, - so there is no need to do makeCurrent in this function. - **/ - virtual GLuint createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) = 0; + // Used when the hardware integration wants to provide its own texture for a given buffer. + // In most cases the compositor creates and manages the texture so this is not needed. + virtual GLuint textureForBuffer(struct ::wl_resource *buffer) { Q_UNUSED(buffer); return 0; } + virtual void destroyTextureForBuffer(struct ::wl_resource *buffer) { Q_UNUSED(buffer); } + + // Called with the texture bound. + virtual void bindTextureToBuffer(struct ::wl_resource *buffer) = 0; + virtual bool isYInverted(struct ::wl_resource *) const { return true; } virtual bool setDirectRenderSurface(QWaylandSurface *) {return false;} |