};
static INLINE void
-pixel_to_float4(PictFormatPtr format,
- CARD32 pixel, float *color)
+render_pixel_to_float4(PictFormatPtr format,
+ CARD32 pixel, float *color)
{
CARD32 r, g, b, a;
}
static void
-bind_framebuffer_state(struct exa_context *exa, PicturePtr pDstPicture,
- struct exa_pixmap_priv *pDst)
+bind_framebuffer_state(struct exa_context *exa, struct exa_pixmap_priv *pDst)
{
unsigned i;
struct pipe_framebuffer_state state;
struct pipe_surface *surface = exa_gpu_surface(exa, pDst);
memset(&state, 0, sizeof(struct pipe_framebuffer_state));
- state.width = pDstPicture->pDrawable->width;
- state.height = pDstPicture->pDrawable->height;
+ state.width = pDst->tex->width[0];
+ state.height = pDst->tex->height[0];
state.nr_cbufs = 1;
state.cbufs[0] = surface;
}
static void
-bind_viewport_state(struct exa_context *exa, PicturePtr pDstPicture)
+bind_viewport_state(struct exa_context *exa, struct exa_pixmap_priv *pDst)
{
- int width = pDstPicture->pDrawable->width;
- int height = pDstPicture->pDrawable->height;
+ int width = pDst->tex->width[0];
+ int height = pDst->tex->height[0];
set_viewport(exa, width, height, Y0_TOP);
}
if (pSrcPicture->pSourcePict->type == SourcePictTypeSolidFill) {
fs_traits |= FS_SOLID_FILL;
vs_traits |= VS_SOLID_FILL;
- pixel_to_float4(pSrcPicture->pFormat,
- pSrcPicture->pSourcePict->solidFill.color,
- exa->solid_color);
+ render_pixel_to_float4(pSrcPicture->pFormat,
+ pSrcPicture->pSourcePict->solidFill.color,
+ exa->solid_color);
} else {
debug_assert("!gradients not supported");
}
struct exa_pixmap_priv *pMask,
struct exa_pixmap_priv *pDst)
{
- bind_framebuffer_state(exa, pDstPicture, pDst);
- bind_viewport_state(exa, pDstPicture);
+ bind_framebuffer_state(exa, pDst);
+ bind_viewport_state(exa, pDst);
bind_blend_state(exa, op, pSrcPicture, pMaskPicture);
bind_rasterizer_state(exa);
bind_shaders(exa, op, pSrcPicture, pMaskPicture);
}
}
+boolean xorg_solid_bind_state(struct exa_context *exa,
+ struct exa_pixmap_priv *pixmap,
+ Pixel fg)
+{
+
+ return TRUE;
+}
+
+void xorg_solid(struct exa_context *exa,
+ struct exa_pixmap_priv *pixmap,
+ int x0, int y0, int x1, int y1)
+{
+}
+
int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int width, int height);
+boolean xorg_solid_bind_state(struct exa_context *exa,
+ struct exa_pixmap_priv *pixmap,
+ Pixel fg);
+void xorg_solid(struct exa_context *exa,
+ struct exa_pixmap_priv *pixmap,
+ int x0, int y0, int x1, int y1);
+
#endif
}
}
+
+static INLINE void
+pixel_to_float4(Pixel pixel, float *color)
+{
+ CARD32 r, g, b, a;
+
+ a = (pixel >> 24) & 0xff;
+ r = (pixel >> 16) & 0xff;
+ g = (pixel >> 8) & 0xff;
+ b = (pixel >> 0) & 0xff;
+ color[0] = ((float)r) / 255.;
+ color[1] = ((float)g) / 255.;
+ color[2] = ((float)b) / 255.;
+ color[3] = ((float)a) / 255.;
+}
+
/*
* Static exported EXA functions
*/
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap);
struct exa_context *exa = ms->exa;
+ debug_printf("ExaPrepareSolid\n");
if (pPixmap->drawable.depth < 15)
return FALSE;
if (alu != GXcopy)
return FALSE;
- if (!exa->ctx || !exa->ctx->surface_fill)
+ if (!exa->ctx)
return FALSE;
- priv->color = fg;
-
- return TRUE;
+ return xorg_solid_bind_state(exa, priv, fg);
}
static void
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa;
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap);
- struct pipe_surface *surf = exa_gpu_surface(exa, priv);
- exa->ctx->surface_fill(exa->ctx, surf, x0, y0, x1 - x0, y1 - y0,
- priv->color);
-
- exa->scrn->tex_surface_destroy(surf);
+ debug_printf("\tExaSolid\n");
+ xorg_solid(exa, priv, x0, y0, x1, y1) ;
}
static Bool
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDstPixmap);
struct exa_pixmap_priv *src_priv = exaGetPixmapDriverPrivate(pSrcPixmap);
+ debug_printf("ExaPrepareCopy\n");
+
if (alu != GXcopy)
return FALSE;
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDstPixmap);
struct pipe_surface *surf = exa_gpu_surface(exa, priv);
+ debug_printf("\tExaCopy\n");
+
exa->ctx->surface_copy(exa->ctx, surf, dstX, dstY, priv->src_surf,
srcX, srcY, width, height);
exa->scrn->tex_surface_destroy(surf);
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa;
+ debug_printf("ExaPrepareComposite\n");
+
return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
pDstPicture,
exaGetPixmapDriverPrivate(pSrc),
struct exa_context *exa = ms->exa;
struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDst);
+ debug_printf("\tExaComposite\n");
+
xorg_composite(exa, priv, srcX, srcY, maskX, maskY,
dstX, dstY, width, height);
}
struct pipe_texture *tex;
struct pipe_texture *depth_stencil_tex;
- unsigned int color;
+ float solid_color[4];
struct pipe_surface *src_surf; /* for copies */
struct pipe_transfer *map_transfer;
TGSI_SEMANTIC_POSITION,
0,
TGSI_INTERPOLATE_PERSPECTIVE);
- }
- if (is_fill) {
+ } else {
+ debug_assert(is_fill);
if (is_solid)
src_input = ureg_DECL_fs_input(ureg,
TGSI_SEMANTIC_COLOR,