diff --git a/src/glamor.c b/src/glamor.c index 7637f3b..e8e68be 100644 --- a/src/glamor.c +++ b/src/glamor.c @@ -413,6 +413,9 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->saved_procs.create_picture = ps->CreatePicture; ps->CreatePicture = glamor_create_picture; + glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap; + screen->SetWindowPixmap = glamor_set_window_pixmap; + glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture; ps->DestroyPicture = glamor_destroy_picture; glamor_init_composite_shaders(screen); @@ -531,6 +534,7 @@ glamor_close_screen(CLOSE_SCREEN_ARGS_DECL) ps->CompositeRects = glamor_priv->saved_procs.composite_rects; ps->Glyphs = glamor_priv->saved_procs.glyphs; ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph; + screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap; #endif screen_pixmap = screen->GetScreenPixmap(screen); glamor_set_pixmap_private(screen_pixmap, NULL); diff --git a/src/glamor_compositerects.c b/src/glamor_compositerects.c index f1564a2..1a57699 100644 --- a/src/glamor_compositerects.c +++ b/src/glamor_compositerects.c @@ -215,8 +215,8 @@ glamor_composite_rectangles(CARD8 op, if (dst->pCompositeClip->data && (!pixman_region_intersect(®ion, ®ion, dst->pCompositeClip) || region_is_empty(®ion))) { - DEBUGF(("%s: zero-intersection between rectangles and clip\n", - __FUNCTION__)); + DEBUGF("%s: zero-intersection between rectangles and clip\n", + __FUNCTION__); pixman_region_fini(®ion); return; } diff --git a/src/glamor_fbo.c b/src/glamor_fbo.c index a46a740..4838a27 100644 --- a/src/glamor_fbo.c +++ b/src/glamor_fbo.c @@ -212,7 +212,7 @@ glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo) break; } - FatalError("destination is framebuffer incomplete: %s [%#x]\n", + FatalError("destination is framebuffer incomplete: %s [%x]\n", str, status); } glamor_put_dispatch(fbo->glamor_priv); diff --git a/src/glamor_priv.h b/src/glamor_priv.h index ffdd7fd..b6a1075 100644 --- a/src/glamor_priv.h +++ b/src/glamor_priv.h @@ -221,6 +221,7 @@ struct glamor_saved_procs { CreatePictureProcPtr create_picture; DestroyPictureProcPtr destroy_picture; UnrealizeGlyphProcPtr unrealize_glyph; + SetWindowPixmapProcPtr set_window_pixmap; }; #ifdef GLAMOR_GLES2 @@ -934,6 +935,8 @@ void glamor_destroy_upload_pixmap(PixmapPtr pixmap); int glamor_create_picture(PicturePtr picture); +void glamor_set_window_pixmap(WindowPtr pWindow, PixmapPtr pPixmap); + Bool glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access); diff --git a/src/glamor_window.c b/src/glamor_window.c index 3da11e4..b67c728 100644 --- a/src/glamor_window.c +++ b/src/glamor_window.c @@ -69,3 +69,35 @@ glamor_change_window_attributes(WindowPtr pWin, unsigned long mask) } return TRUE; } + +void +glamor_set_window_pixmap(WindowPtr win, PixmapPtr pPixmap) +{ + ScreenPtr screen = win->drawable.pScreen; + glamor_screen_private *glamor_priv = + glamor_get_screen_private(screen); + PixmapPtr old = screen->GetWindowPixmap(win); + + if (pPixmap != old) { + glamor_pixmap_private *pixmap_priv; + PicturePtr pic = NULL; + + pixmap_priv = glamor_get_pixmap_private(old); + if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) && pixmap_priv->base.picture->pDrawable == (DrawablePtr)win) { + pic = pixmap_priv->base.picture; + pixmap_priv->base.is_picture = 0; + pixmap_priv->base.picture = NULL; + } + + pixmap_priv = glamor_get_pixmap_private(pPixmap); + if (pixmap_priv) { + pixmap_priv->base.is_picture = !!pic; + pixmap_priv->base.picture = pic; + } + } + + screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap; + (screen->SetWindowPixmap)(win, pPixmap); + glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap; + screen->SetWindowPixmap = glamor_set_window_pixmap; +}