glamor: Drop tracking of the last picture attached to pixmaps.
Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
0dbdb83b0d
commit
8097c88702
|
@ -649,15 +649,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|||
glamor_priv->saved_procs.glyphs = ps->Glyphs;
|
||||
ps->Glyphs = glamor_composite_glyphs;
|
||||
|
||||
glamor_priv->saved_procs.create_picture = ps->CreatePicture;
|
||||
ps->CreatePicture = glamor_create_picture;
|
||||
|
||||
glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture;
|
||||
ps->DestroyPicture = glamor_destroy_picture;
|
||||
|
||||
glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
|
||||
screen->SetWindowPixmap = glamor_set_window_pixmap;
|
||||
|
||||
glamor_init_vbo(screen);
|
||||
glamor_init_pixmap_fbo(screen);
|
||||
glamor_init_finish_access_shaders(screen);
|
||||
|
@ -719,10 +710,8 @@ glamor_close_screen(ScreenPtr screen)
|
|||
ps->Composite = glamor_priv->saved_procs.composite;
|
||||
ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
|
||||
ps->Triangles = glamor_priv->saved_procs.triangles;
|
||||
ps->CreatePicture = glamor_priv->saved_procs.create_picture;
|
||||
ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
|
||||
ps->Glyphs = glamor_priv->saved_procs.glyphs;
|
||||
screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
|
||||
|
||||
screen_pixmap = screen->GetScreenPixmap(screen);
|
||||
glamor_pixmap_destroy_fbo(screen_pixmap);
|
||||
|
|
|
@ -900,51 +900,3 @@ glamor_upload_picture_to_texture(PicturePtr picture)
|
|||
else
|
||||
return GLAMOR_UPLOAD_FAILED;
|
||||
}
|
||||
|
||||
/*
|
||||
* We should already have drawable attached to it, if it has one.
|
||||
* Then set the attached pixmap to is_picture format, and set
|
||||
* the pict format.
|
||||
* */
|
||||
int
|
||||
glamor_create_picture(PicturePtr picture)
|
||||
{
|
||||
PixmapPtr pixmap;
|
||||
glamor_pixmap_private *pixmap_priv;
|
||||
|
||||
if (!picture || !picture->pDrawable)
|
||||
return 0;
|
||||
|
||||
pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
|
||||
pixmap_priv = glamor_get_pixmap_private(pixmap);
|
||||
pixmap_priv->is_picture = 1;
|
||||
pixmap_priv->picture = picture;
|
||||
|
||||
return miCreatePicture(picture);
|
||||
}
|
||||
|
||||
void
|
||||
glamor_destroy_picture(PicturePtr picture)
|
||||
{
|
||||
PixmapPtr pixmap;
|
||||
glamor_pixmap_private *pixmap_priv;
|
||||
|
||||
if (!picture || !picture->pDrawable)
|
||||
return;
|
||||
|
||||
pixmap = glamor_get_drawable_pixmap(picture->pDrawable);
|
||||
pixmap_priv = glamor_get_pixmap_private(pixmap);
|
||||
|
||||
if (pixmap_priv) {
|
||||
pixmap_priv->is_picture = 0;
|
||||
pixmap_priv->picture = NULL;
|
||||
}
|
||||
miDestroyPicture(picture);
|
||||
}
|
||||
|
||||
void
|
||||
glamor_picture_format_fixup(PicturePtr picture,
|
||||
glamor_pixmap_private *pixmap_priv)
|
||||
{
|
||||
pixmap_priv->picture = picture;
|
||||
}
|
||||
|
|
|
@ -173,9 +173,6 @@ struct glamor_saved_procs {
|
|||
BitmapToRegionProcPtr bitmap_to_region;
|
||||
TrianglesProcPtr triangles;
|
||||
AddTrapsProcPtr addtraps;
|
||||
CreatePictureProcPtr create_picture;
|
||||
DestroyPictureProcPtr destroy_picture;
|
||||
SetWindowPixmapProcPtr set_window_pixmap;
|
||||
#if XSYNC
|
||||
SyncScreenFuncsRec sync_screen_funcs;
|
||||
#endif
|
||||
|
@ -350,13 +347,10 @@ typedef struct glamor_pixmap_private {
|
|||
* that data on glamor_finish_access().
|
||||
*/
|
||||
glamor_access_t map_access;
|
||||
/** Set if the pixmap is currenty attached to a Picture. */
|
||||
unsigned char is_picture:1;
|
||||
glamor_pixmap_fbo *fbo;
|
||||
/** current fbo's coords in the whole pixmap. */
|
||||
BoxRec box;
|
||||
int drm_stride;
|
||||
PicturePtr picture;
|
||||
GLuint pbo;
|
||||
RegionRec prepare_region;
|
||||
Bool prepared;
|
||||
|
@ -734,15 +728,6 @@ Bool glamor_composite_largepixmap_region(CARD8 op,
|
|||
**/
|
||||
enum glamor_pixmap_status glamor_upload_picture_to_texture(PicturePtr picture);
|
||||
|
||||
int glamor_create_picture(PicturePtr picture);
|
||||
|
||||
void glamor_set_window_pixmap(WindowPtr pWindow, PixmapPtr pPixmap);
|
||||
|
||||
void glamor_destroy_picture(PicturePtr picture);
|
||||
|
||||
void glamor_picture_format_fixup(PicturePtr picture,
|
||||
glamor_pixmap_private *pixmap_priv);
|
||||
|
||||
void glamor_add_traps(PicturePtr pPicture,
|
||||
INT16 x_off, INT16 y_off, int ntrap, xTrap *traps);
|
||||
|
||||
|
|
|
@ -936,9 +936,6 @@ glamor_composite_choose_shader(CARD8 op,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (source->format != saved_source_format) {
|
||||
glamor_picture_format_fixup(source, source_pixmap_priv);
|
||||
}
|
||||
/* XXX
|
||||
* By default, glamor_upload_picture_to_texture will wire alpha to 1
|
||||
* if one picture doesn't have alpha. So we don't do that again in
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#define __GLAMOR_UTILS_H__
|
||||
|
||||
#include "glamor_prepare.h"
|
||||
#include "mipict.h"
|
||||
|
||||
#define v_from_x_coord_x(_xscale_, _x_) ( 2 * (_x_) * (_xscale_) - 1.0)
|
||||
#define v_from_x_coord_y(_yscale_, _y_) (-2 * (_y_) * (_yscale_) + 1.0)
|
||||
|
@ -756,7 +757,6 @@ glamor_translate_boxes(BoxPtr boxes, int nbox, int dx, int dy)
|
|||
|| _depth_ == 30 \
|
||||
|| _depth_ == 32)
|
||||
|
||||
#define GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) (pixmap_priv->is_picture == 1)
|
||||
#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
|
||||
|
||||
/**
|
||||
|
@ -1287,9 +1287,9 @@ glamor_compare_pictures(ScreenPtr screen,
|
|||
|
||||
if (fst_pixmap->drawable.depth != snd_pixmap->drawable.depth) {
|
||||
if (fst_generated)
|
||||
glamor_destroy_picture(fst_picture);
|
||||
miDestroyPicture(fst_picture);
|
||||
if (snd_generated)
|
||||
glamor_destroy_picture(snd_picture);
|
||||
miDestroyPicture(snd_picture);
|
||||
|
||||
ErrorF("Different pixmap depth can not compare!\n");
|
||||
return;
|
||||
|
@ -1315,9 +1315,9 @@ glamor_compare_pictures(ScreenPtr screen,
|
|||
glamor_finish_access(&snd_pixmap->drawable);
|
||||
|
||||
if (fst_generated)
|
||||
glamor_destroy_picture(fst_picture);
|
||||
miDestroyPicture(fst_picture);
|
||||
if (snd_generated)
|
||||
glamor_destroy_picture(snd_picture);
|
||||
miDestroyPicture(snd_picture);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -65,35 +65,3 @@ 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->picture->pDrawable == (DrawablePtr) win) {
|
||||
pic = pixmap_priv->picture;
|
||||
pixmap_priv->is_picture = 0;
|
||||
pixmap_priv->picture = NULL;
|
||||
}
|
||||
|
||||
pixmap_priv = glamor_get_pixmap_private(pPixmap);
|
||||
if (pixmap_priv) {
|
||||
pixmap_priv->is_picture = ! !pic;
|
||||
pixmap_priv->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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user