static void endDirectPaint() { #if JWC_WINCE_USE_DIRECT_DRAW g_pDDSPrimary->Unlock(NULL); #else GXEndDraw(); #endif }
extern "C" int GXENDDRAW() { #ifndef _USE_GAPI_ return gx->EndDraw(); #else return GXEndDraw(); #endif }
bool SkWindow::update(SkIRect* updateArea) { if (!fDirtyRgn.isEmpty()) { SkBitmap bm = this->getBitmap(); #if defined(SK_BUILD_FOR_WINCE) && defined(USE_GX_SCREEN) char* buffer = (char*)GXBeginDraw(); SkASSERT(buffer); RECT rect; GetWindowRect((HWND)((SkOSWindow*)this)->getHWND(), &rect); buffer += rect.top * gDisplayProps.cbyPitch + rect.left * gDisplayProps.cbxPitch; bm.setPixels(buffer); #endif SkAutoTUnref<SkSurface> surface(this->createSurface()); SkCanvas* canvas = surface->getCanvas(); canvas->clipRegion(fDirtyRgn); if (updateArea) *updateArea = fDirtyRgn.getBounds(); SkAutoCanvasRestore acr(canvas, true); canvas->concat(fMatrix); // empty this now, so we can correctly record any inval calls that // might be made during the draw call. fDirtyRgn.setEmpty(); #ifdef SK_SIMULATE_FAILED_MALLOC gEnableControlledThrow = true; #endif #ifdef SK_BUILD_FOR_WIN32 //try { this->draw(canvas); //} //catch (...) { //} #else this->draw(canvas); #endif #ifdef SK_SIMULATE_FAILED_MALLOC gEnableControlledThrow = false; #endif #if defined(SK_BUILD_FOR_WINCE) && defined(USE_GX_SCREEN) GXEndDraw(); #endif return true; } return false; }
static void Unlock(picture_t *picture) { vout_display_t *vd = picture->p_sys->vd; GXEndDraw(); }
static GF_Err GAPI_FlipBackBuffer(GF_VideoOutput *dr) { GF_VideoSurface src, dst; unsigned char *ptr; GAPICTX(dr); if (!gctx || !gctx->gx_mode) return GF_BAD_PARAM; /*get a pointer to video memory*/ if (gctx->gx_mode==1) { ptr = (unsigned char *) GXBeginDraw(); } else { ptr = (unsigned char *) gctx->raw_ptr; } if (!ptr) return GF_IO_ERR; src.video_buffer = gctx->backbuffer; src.width = gctx->bb_width; src.height = gctx->bb_height; src.pitch_x = gctx->BPP; src.pitch_y = gctx->y_pitch; src.pixel_format = gctx->pixel_format; src.is_hardware_memory = 0; dst.width = gctx->dst_blt.w; dst.height = gctx->dst_blt.h; dst.pixel_format = gctx->pixel_format; dst.is_hardware_memory = 1; dst.video_buffer = (char*)ptr; dst.pitch_x = gctx->x_pitch; dst.pitch_y = gctx->y_pitch; if (gctx->fullscreen) { if (gctx->erase_dest) { gctx->erase_dest = 0; GAPI_ClearFS(gctx, ptr); } } else { gctx->dst_blt.x += gctx->off_x; gctx->dst_blt.y += gctx->off_y; } /*apply x/y offset*/ if (!gctx->fullscreen) dst.video_buffer += gctx->dst_blt.x * gctx->x_pitch + gctx->y_pitch * gctx->dst_blt.y; if (gctx->contiguous_mem) { memcpy(dst.video_buffer, src.video_buffer, src.width*gctx->BPP*src.height ); } else if (landscape) { u32 y, lsize = dst.height*gctx->x_pitch; for (y=0; y<dst.width; y++) { char *s = src.video_buffer + y*gctx->y_pitch; char *d = dst.video_buffer + y*gctx->y_pitch; memcpy(d, s, lsize); } } else { u32 y, lsize = dst.width*gctx->x_pitch; for (y=0; y<dst.height; y++) { char *s = src.video_buffer + y*gctx->y_pitch; char *d = dst.video_buffer + y*gctx->y_pitch; memcpy(d, s, lsize); } } if (gctx->gx_mode==1) GXEndDraw(); return GF_OK; }