Beispiel #1
0
static void
ExaCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY,
	int width, int height)
{
   ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
   modesettingPtr ms = modesettingPTR(pScrn);
   struct exa_context *exa = ms->exa;
   struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDstPixmap);

   exa_debug_printf("\tExaCopy(srcx=%d, srcy=%d, dstX=%d, dstY=%d, w=%d, h=%d)\n",
                srcX, srcY, dstX, dstY, width, height);

   debug_assert(priv == exa->copy.dst);
   (void) priv;

   if (exa->copy.use_surface_copy) {
      struct pipe_box src_box;
      u_box_2d(srcX, srcY, width, height, &src_box);
      exa->pipe->resource_copy_region( exa->pipe,
                                       exa->copy.dst->tex,
                                       0,
                                       dstX, dstY, 0,
                                       exa->copy.src->tex,
                                       0, &src_box);
   }
   else {
      renderer_copy_pixmap(exa->renderer, 
                           dstX, dstY,
                           srcX, srcY,
                           width, height,
                           exa->copy.src_texture->width0,
                           exa->copy.src_texture->height0);
   }
}
Beispiel #2
0
static void
ExaCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY,
	int width, int height)
{
   ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
   modesettingPtr ms = modesettingPTR(pScrn);
   struct exa_context *exa = ms->exa;
   struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDstPixmap);

#if DEBUG_PRINT
   debug_printf("\tExaCopy(srcx=%d, srcy=%d, dstX=%d, dstY=%d, w=%d, h=%d)\n",
                srcX, srcY, dstX, dstY, width, height);
#endif

   debug_assert(priv == exa->copy.dst);
   (void) priv;

   if (exa->copy.use_surface_copy) {
      /* XXX: consider exposing >1 box in surface_copy interface.
       */
      exa->pipe->surface_copy( exa->pipe,
                             exa->copy.dst_surface,
                             dstX, dstY,
                             exa->copy.src_surface,
                             srcX, srcY,
                             width, height );
   }
   else {
      renderer_copy_pixmap(exa->renderer, 
                           dstX, dstY,
                           srcX, srcY,
                           width, height,
                           exa->copy.src_texture->width0,
                           exa->copy.src_texture->height0);
   }
}