/* photon_blit_to_self: * Accelerated vram -> vram blitting routine. */ static void photon_blit_to_self(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height) { struct Ph_rect source_rect = { { source_x + source->x_ofs, source_y + source->y_ofs }, { source_x + source->x_ofs + width - 1, source_y + source->y_ofs + height - 1 } }; struct Ph_rect dest_rect = { { dest_x + dest->x_ofs, dest_y + dest->y_ofs }, { dest_x + dest->x_ofs + width - 1, dest_y + dest->y_ofs + height - 1 } }; struct BITMAP *source_parent, *dest_parent; /* find parents */ source_parent = source; while (source_parent->id & BMP_ID_SUB) source_parent = (BITMAP *)source_parent->extra; dest_parent = dest; while (dest_parent->id & BMP_ID_SUB) dest_parent = (BITMAP *)dest_parent->extra; PgContextBlit(BMP_EXTRA(source_parent)->context, &source_rect, BMP_EXTRA(dest_parent)->context, &dest_rect); /* only for windowed mode */ if (dest_parent == pseudo_screen) ph_update_window(&dest_rect); }
// this function blits the given buffer using our blit type method inline void BlitBuffer(PtWidget_t *win,CoolImage *i) { // For blit type 0, we use PgDrawImagemx(). We have to make sure // to set the region to the windows region first. Don't forget // to flush! :) if (blittype==0 || blittype==1) { PhPoint_t pos={0,0}; PhDim_t size; //size.w = 768; size.w = m_W; size.h = m_H; //size.h = 576; PgSetRegion(PtWidgetRid(win)); //PgDrawImagemx(i->buffer,Pg_IMAGE_DIRECT_565,&pos,&size,i->pitch,0); PgDrawImagemx(i->buffer,Pg_IMAGE_DIRECT_888,&pos,&size,i->pitch,0); PgFlush(); }else if (blittype == 2) { PhRect_t r={{0,0},{i->width,i->height}}; PgSetRegion(PtWidgetRid(win)); PgContextBlit(i->ctx,&r,NULL,&r); PgFlush(); } }
/* ddraw_masked_blit: * Accelerated masked blitting routine. */ static void photon_masked_blit(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height) { struct Ph_rect source_rect = { { source_x + source->x_ofs, source_y + source->y_ofs }, { source_x + source->x_ofs + width - 1, source_y + source->y_ofs + height - 1 } }; struct Ph_rect dest_rect = { { dest_x + dest->x_ofs, dest_y + dest->y_ofs }, { dest_x + dest->x_ofs + width - 1, dest_y + dest->y_ofs + height - 1 } }; struct BITMAP *dest_parent, *source_parent; if (is_video_bitmap(source)) { if (!chroma_on) { PgChromaOn(); chroma_on = TRUE; } /* find parents */ source_parent = source; while (source_parent->id & BMP_ID_SUB) source_parent = (BITMAP *)source_parent->extra; dest_parent = dest; while (dest_parent->id & BMP_ID_SUB) dest_parent = (BITMAP *)dest_parent->extra; PgContextBlit(BMP_EXTRA(source_parent)->context, &source_rect, BMP_EXTRA(dest_parent)->context, &dest_rect); /* only for windowed mode */ if (dest_parent == pseudo_screen) ph_update_window(&dest_rect); } else { /* have to use the original software version */ _orig_masked_blit(source, dest, source_x, source_y, dest_x, dest_y, width, height); } }
/***************************************************************************** * QNXDisplay: displays previously rendered output ***************************************************************************** * This function send the currently rendered image to QNX server, wait until * it is displayed and switch the two rendering buffer, preparing next frame. *****************************************************************************/ static void QNXDisplay( vout_thread_t *p_vout, picture_t *p_pic ) { if( p_vout->p_sys->i_mode == MODE_NORMAL_MEM || p_vout->p_sys->i_mode == MODE_SHARED_MEM ) { PhPoint_t pos = { 0, 0 }; PgSetRegion( PtWidgetRid( p_vout->p_sys->p_window ) ); if (p_vout->p_sys->i_screen_depth == 8) { PgSetPalette( p_vout->p_sys->p_colors, 0, 0, 255, Pg_PALSET_SOFT, 0); } PgDrawPhImagemx( &pos, p_pic->p_sys->p_image, 0 ); PgFlush(); } else if( p_vout->p_sys->i_mode == MODE_VIDEO_MEM ) { PhRect_t rc = { { 0, 0 }, { p_vout->output.i_width, p_vout->output.i_height } }; // PgSetRegion( PtWidgetRid ( p_vout->p_sys->p_window ) ); PgContextBlit( p_pic->p_sys->p_ctx[0], &rc, NULL, &rc ); PgFlush(); } }