glamor: Add fallbacks for glamor_copy_area().
This commit is contained in:
parent
ca58607a44
commit
de675893b7
|
@ -80,27 +80,22 @@ glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc,
|
||||||
RegionPtr region;
|
RegionPtr region;
|
||||||
|
|
||||||
if (!GLEW_EXT_framebuffer_blit) {
|
if (!GLEW_EXT_framebuffer_blit) {
|
||||||
ErrorF("EXT_framebuffer_blit unsupported\n");
|
glamor_fallback("glamor_copy_area(): "
|
||||||
|
"EXT_framebuffer_blit unsupported\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!glamor_set_destination_pixmap(dst_pixmap)) {
|
if (!glamor_set_destination_pixmap(dst_pixmap))
|
||||||
/*
|
goto fail;
|
||||||
return miDoCopy(pSrcDrawable, pDstDrawable, pGC,
|
|
||||||
srcx, srcy, width, height,
|
|
||||||
dstx, dsty, fbCopyNtoN, 0, NULL);
|
|
||||||
*/
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (src_priv == NULL) {
|
if (src_priv == NULL) {
|
||||||
ErrorF("glamor_copy_area: no src pixmap priv?");
|
glamor_fallback("glamor_copy_area(): no src pixmap priv");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src_priv->fb == 0 && src_pixmap != screen_pixmap) {
|
if (src_priv->fb == 0 && src_pixmap != screen_pixmap) {
|
||||||
ErrorF("glamor_copy_area: No src FBO\n");
|
glamor_fallback("glamor_copy_area(): no src fbo");
|
||||||
return NULL;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, src_priv->fb);
|
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, src_priv->fb);
|
||||||
|
@ -112,5 +107,17 @@ glamor_copy_area(DrawablePtr src, DrawablePtr dst, GCPtr gc,
|
||||||
return region;
|
return region;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
return NULL;
|
glamor_fallback("glamor_copy_area from %p to %p (%c,%c)\n", src, dst,
|
||||||
|
glamor_get_drawable_location(src),
|
||||||
|
glamor_get_drawable_location(dst));
|
||||||
|
region = NULL;
|
||||||
|
if (glamor_prepare_access(dst, GLAMOR_ACCESS_RW)) {
|
||||||
|
if (glamor_prepare_access(src, GLAMOR_ACCESS_RO)) {
|
||||||
|
region = fbCopyArea(src, dst, gc, srcx, srcy, width, height,
|
||||||
|
dstx, dsty);
|
||||||
|
glamor_finish_access(src);
|
||||||
|
}
|
||||||
|
glamor_finish_access(dst);
|
||||||
|
}
|
||||||
|
return region;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,26 @@
|
||||||
|
|
||||||
#include "glamor_priv.h"
|
#include "glamor_priv.h"
|
||||||
|
|
||||||
|
const Bool
|
||||||
|
glamor_get_drawable_location(const DrawablePtr drawable)
|
||||||
|
{
|
||||||
|
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
|
||||||
|
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
|
||||||
|
if (pixmap_priv == NULL)
|
||||||
|
return 'm';
|
||||||
|
if (pixmap_priv->fb == 0)
|
||||||
|
return 's';
|
||||||
|
else
|
||||||
|
return 'f';
|
||||||
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
glamor_set_destination_pixmap(PixmapPtr pixmap)
|
glamor_set_destination_pixmap(PixmapPtr pixmap)
|
||||||
{
|
{
|
||||||
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
|
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
|
||||||
|
|
||||||
if (pixmap_priv == NULL) {
|
if (pixmap_priv == NULL) {
|
||||||
ErrorF("no pixmap priv?");
|
glamor_fallback("glamor_set_destination_pixmap(): no pixmap priv");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +67,7 @@ glamor_set_destination_pixmap(PixmapPtr pixmap)
|
||||||
PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
|
PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
|
||||||
|
|
||||||
if (pixmap != screen_pixmap) {
|
if (pixmap != screen_pixmap) {
|
||||||
ErrorF("No FBO\n");
|
glamor_fallback("glamor_set_destination_pixmap(): no fbo");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,17 @@ glamor_pm_is_solid(DrawablePtr drawable, unsigned long planemask)
|
||||||
FbFullMask(drawable->depth);
|
FbFullMask(drawable->depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
glamor_fallback(char *format, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
|
LogMessageVerb(X_INFO, 1, "glamor fallback: ");
|
||||||
|
LogVMessageVerb(X_INFO, 1, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
|
||||||
/* glamor.c */
|
/* glamor.c */
|
||||||
PixmapPtr glamor_get_drawable_pixmap(DrawablePtr drawable);
|
PixmapPtr glamor_get_drawable_pixmap(DrawablePtr drawable);
|
||||||
|
|
||||||
|
@ -129,6 +140,7 @@ Bool glamor_prepare_access(DrawablePtr drawable, glamor_access_t access);
|
||||||
void glamor_finish_access(DrawablePtr drawable);
|
void glamor_finish_access(DrawablePtr drawable);
|
||||||
Bool glamor_prepare_access_window(WindowPtr window);
|
Bool glamor_prepare_access_window(WindowPtr window);
|
||||||
void glamor_finish_access_window(WindowPtr window);
|
void glamor_finish_access_window(WindowPtr window);
|
||||||
|
const Bool glamor_get_drawable_location(const DrawablePtr drawable);
|
||||||
Bool glamor_create_gc(GCPtr gc);
|
Bool glamor_create_gc(GCPtr gc);
|
||||||
void glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple,
|
void glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple,
|
||||||
int x, int y, int width, int height,
|
int x, int y, int width, int height,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user