so there is no need to do makeCurrent in this function.
**/
virtual GLuint createTextureFromBuffer(struct wl_buffer *buffer) = 0;
- virtual bool isYInverted(struct wl_buffer *) const { return false; }
+ virtual bool isYInverted(struct wl_buffer *) const { return true; }
virtual bool setDirectRenderSurface(WaylandSurface *) {return false;}
virtual bool postBuffer(struct wl_buffer *) {return false;}
attribList.append(GLX_TEXTURE_2D_EXT);
attribList.append(0);
GLXPixmap glxPixmap = glXCreatePixmap(mDisplay,*configs,pixmap,attribList.constData());
+
+ uint inverted;
+ glXQueryDrawable(mDisplay, glxPixmap, GLX_Y_INVERTED_EXT,&inverted);
+ compositorBuffer->setInvertedY(!inverted);
+
XFree(configs);
GLuint textureId;
// m_glxReleaseTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT);
return textureId;
}
+
+bool XCompositeGLXIntegration::isYInverted(wl_buffer *buffer) const
+{
+ XCompositeBuffer *compositorBuffer = Wayland::wayland_cast<XCompositeBuffer *>(buffer);
+ return compositorBuffer->isYInverted();
+}
void initializeHardware(Wayland::Display *waylandDisplay);
GLuint createTextureFromBuffer(struct wl_buffer *buffer);
+ bool isYInverted(wl_buffer *) const;
private:
PFNGLXBINDTEXIMAGEEXTPROC m_glxBindTexImageEXT;
XCompositeBuffer::XCompositeBuffer(Wayland::Compositor *compositor, Window window, const QSize &size, struct wl_visual *visual)
: mWindow(window)
+ , mInvertedY(false)
{
base()->compositor = compositor->base();
base()->height = size.height();
static void delete_resource(struct wl_resource *resource,
struct wl_client *client);
+ bool isYInverted() const { return mInvertedY; }
+ void setInvertedY(bool inverted) { mInvertedY = inverted; }
private:
Window mWindow;
+ bool mInvertedY;
static void buffer_interface_destroy(struct wl_client *client,
struct wl_buffer *buffer);
bool Surface::isYInverted() const
{
Q_D(const Surface);
- if (d->type() == WaylandSurface::Texture) {
- return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer());
+ if (d->type() == WaylandSurface::Texture || d->type() == WaylandSurface::Direct) {
+ if (textureId()) {
+ return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer());
+ }
}
+ //shm surfaces are not flipped (in our "world")
return false;
}