From b5480e64ac4a72bdc31e587ff9e51d67a1a0f11d Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Fri, 9 Dec 2011 14:57:24 +0800 Subject: [PATCH] Override create/destroy picture to track pict format. When create a piccture, we need to attach a pixmap to it. A pixmap only has a depth, which is not sufficant for glamor. As in openGL texture only has a few internal formats which is not sufficant to represent all the possible picture format. So we always transform the picture format to GL_RGBA. And when we need to read back the picture, we must know the original picture format. So we have to override create and destroy picture to track a pixmap's real picture format if it is attached to a picture. Signed-off-by: Zhigang Gong --- glamor/glamor.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/glamor/glamor.c b/glamor/glamor.c index b660f95e9..482a07416 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -388,16 +388,14 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_priv->saved_triangles = ps->Triangles; ps->Triangles = glamor_triangles; - glamor_priv->saved_create_picture = ps->CreatePicture; - ps->CreatePicture = glamor_create_picture; - - glamor_priv->saved_destroy_picture = ps->DestroyPicture; - ps->DestroyPicture = glamor_destroy_picture; - glamor_priv->saved_unrealize_glyph = ps->UnrealizeGlyph; ps->UnrealizeGlyph = glamor_glyph_unrealize; } + glamor_priv->saved_create_picture = ps->CreatePicture; + ps->CreatePicture = glamor_create_picture; + glamor_priv->saved_destroy_picture = ps->DestroyPicture; + ps->DestroyPicture = glamor_destroy_picture; glamor_init_composite_shaders(screen); #endif glamor_init_solid_shader(screen);