diff options
author | marha <marha@users.sourceforge.net> | 2014-07-19 15:00:38 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-07-19 15:00:38 +0200 |
commit | d0c30e7945e76ac119f6d867e27137c8a76f7e15 (patch) | |
tree | 1bfb3148a6f43bdd32746c5b882f9f083076cf91 /xorg-server/glamor/glamor_transform.c | |
parent | e708bebcc029873004ade4241f347ce8c58896af (diff) | |
download | vcxsrv-d0c30e7945e76ac119f6d867e27137c8a76f7e15.tar.gz vcxsrv-d0c30e7945e76ac119f6d867e27137c8a76f7e15.tar.bz2 vcxsrv-d0c30e7945e76ac119f6d867e27137c8a76f7e15.zip |
fontconfig plink libX11 libxcb mesa git update 19 July 2014
plink revision 10207
xserver commit cfa302d6224d10860e60491333950544c4fb9b04
libxcb commit 49a61c8b459ab19c7f39e653bbb0d0339ea8f00f
libX11 commit 5525e8433f93bce464412f27cffa203ea628f368
fontconfig commit 6781c6baef062eeea5b5b68e4a9c31ea6cd7539b
mesa commit f6fc80734533140a69b30361fe0d4773a03515db
Diffstat (limited to 'xorg-server/glamor/glamor_transform.c')
-rw-r--r-- | xorg-server/glamor/glamor_transform.c | 72 |
1 files changed, 69 insertions, 3 deletions
diff --git a/xorg-server/glamor/glamor_transform.c b/xorg-server/glamor/glamor_transform.c index d6ba56421..c1df56018 100644 --- a/xorg-server/glamor/glamor_transform.c +++ b/xorg-server/glamor/glamor_transform.c @@ -198,6 +198,64 @@ glamor_set_tiled(PixmapPtr pixmap, size_uniform); } +static PixmapPtr +glamor_get_stipple_pixmap(GCPtr gc) +{ + glamor_gc_private *gc_priv = glamor_get_gc_private(gc); + ScreenPtr screen = gc->pScreen; + PixmapPtr bitmap; + PixmapPtr pixmap; + GCPtr scratch_gc; + ChangeGCVal changes[2]; + + if (gc_priv->stipple) + return gc_priv->stipple; + + bitmap = gc->stipple; + if (!bitmap) + goto bail; + + pixmap = glamor_create_pixmap(screen, + bitmap->drawable.width, + bitmap->drawable.height, + 8, GLAMOR_CREATE_NO_LARGE); + if (!pixmap) + goto bail; + + scratch_gc = GetScratchGC(8, screen); + if (!scratch_gc) + goto bail_pixmap; + + changes[0].val = 0xff; + changes[1].val = 0x00; + if (ChangeGC(NullClient, scratch_gc, + GCForeground|GCBackground, changes) != Success) + goto bail_gc; + ValidateGC(&pixmap->drawable, scratch_gc); + + (*scratch_gc->ops->CopyPlane)(&bitmap->drawable, + &pixmap->drawable, + scratch_gc, + 0, 0, + bitmap->drawable.width, + bitmap->drawable.height, + 0, 0, 0x1); + + FreeScratchGC(scratch_gc); + gc_priv->stipple = pixmap; + + glamor_track_stipple(gc); + + return pixmap; + +bail_gc: + FreeScratchGC(scratch_gc); +bail_pixmap: + glamor_destroy_pixmap(pixmap); +bail: + return NULL; +} + Bool glamor_set_stippled(PixmapPtr pixmap, GCPtr gc, @@ -205,11 +263,19 @@ glamor_set_stippled(PixmapPtr pixmap, GLint offset_uniform, GLint size_uniform) { - if (!glamor_set_solid(pixmap, gc, TRUE, fg_uniform)) + PixmapPtr stipple; + + stipple = glamor_get_stipple_pixmap(gc); + if (!stipple) return FALSE; - if (!glamor_set_texture(pixmap, gc->stipple, gc->patOrg.x, gc->patOrg.y, offset_uniform, size_uniform)) + if (!glamor_set_solid(pixmap, gc, TRUE, fg_uniform)) return FALSE; - return TRUE; + return glamor_set_texture(pixmap, + stipple, + -gc->patOrg.x, + -gc->patOrg.y, + offset_uniform, + size_uniform); } |