Lines Matching refs:This

9  *This library is free software; you can redistribute it and/or
14 *This library is distributed in the hope that it will be useful,
45 #define GLINFO_LOCATION This->device->adapter->gl_info
142 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
147 IWineD3DSwapChain_SetGammaRamp(iface, 0, &This->orig_gamma);
152 IWineD3DDevice_RemoveSwapChain((IWineD3DDevice*)This->device, (IWineD3DSwapChain*)This);
154 swapchain_cleanup_refs(This);
157 /* Release the swapchain's draw buffers. Make sure This->backBuffer[0] is
159 if (This->frontBuffer)
161 IWineD3DSurface_SetContainer(This->frontBuffer, 0);
162 if (IWineD3DSurface_Release(This->frontBuffer))
165 This, This->frontBuffer);
167 This->frontBuffer = NULL;
170 if (This->backBuffer)
172 i = This->presentParms.BackBufferCount;
176 IWineD3DSurface_SetContainer(This->backBuffer[i], 0);
177 if (IWineD3DSurface_Release(This->backBuffer[i]))
179 This, i, This->backBuffer[i]);
181 HeapFree(GetProcessHeap(), 0, This->backBuffer);
182 This->backBuffer = NULL;
185 for (i = 0; i < This->num_contexts; ++i)
187 context_destroy(This->device, This->context[i]);
192 if (This->presentRt)
194 IWineD3DSurfaceImpl *old = (IWineD3DSurfaceImpl*)This->presentRt;
196 IWineD3DSurface_Release(This->presentRt);
197 This->presentRt = NULL;
200 if(This->win_handle) {
201 VBoxExtWndDestroy(This->win_handle, This->hDC);
202 swapchain_invalidate(This);
209 IWineD3DDevice_RemoveSwapChain((IWineD3DDevice*)This->device, (IWineD3DSwapChain*)This);
210 if (!This->device->NumberOfSwapChains)
213 * This will restore the screen resolution to what it was before creating the swapchain. In case of d3d8 and d3d9
217 if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) {
219 mode.Width = This->orig_width;
220 mode.Height = This->orig_height;
222 mode.Format = This->orig_fmt;
223 IWineD3DDevice_SetDisplayMode((IWineD3DDevice *)This->device, 0, &mode);
227 HeapFree(GetProcessHeap(), 0, This->context);
230 HeapFree(GetProcessHeap(), 0, This);
234 static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *context,
237 IWineD3DDeviceImpl *device = This->device;
238 IWineD3DSurfaceImpl *backbuffer = ((IWineD3DSurfaceImpl *) This->backBuffer[0]);
245 This, context, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect));
263 IWineD3DDeviceImpl_MarkStateDirty(This->device, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
280 context2 = context_acquire(This->device, This->backBuffer[0], CTXUSAGE_BLIT);
349 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
358 if (!This->hDC)
367 context = context_acquire(This->device, This->backBuffer[0], CTXUSAGE_RESOURCELOAD);
376 if (This->device->bCursorVisible && This->device->cursorTexture)
381 This->device->xScreenSpace - This->device->xHotSpot,
382 This->device->yScreenSpace - This->device->yHotSpot,
383 This->device->xScreenSpace + This->device->cursorWidth - This->device->xHotSpot,
384 This->device->yScreenSpace + This->device->cursorHeight - This->device->yHotSpot,
394 cursor.resource.device = This->device;
398 cursor.texture_name = This->device->cursorTexture;
401 cursor.currentDesc.Width = This->device->cursorWidth;
402 cursor.currentDesc.Height = This->device->cursorHeight;
411 if (This->presentParms.Windowed) {
415 MapWindowPoints(NULL, This->win_handle, (LPPOINT)&destRect, 2);
417 IWineD3DSurface_Blt(This->backBuffer[0], &destRect, (IWineD3DSurface *)&cursor,
421 if (This->device->logo_surface)
424 IWineD3DSurface_BltFast(This->backBuffer[0], 0, 0, This->device->logo_surface, NULL, WINEDDBLTFAST_SRCCOLORKEY);
433 render_to_fbo = This->render_to_fbo;
439 || src_rect.right != This->presentParms.BackBufferWidth
440 || src_rect.bottom != This->presentParms.BackBufferHeight))
449 src_rect.right = This->presentParms.BackBufferWidth;
450 src_rect.bottom = This->presentParms.BackBufferHeight;
456 GetClientRect(This->win_handle, &dst_rect);
459 || dst_rect.right != This->presentParms.BackBufferWidth
460 || dst_rect.bottom != This->presentParms.BackBufferHeight))
469 dst_rect.right = This->presentParms.BackBufferWidth;
470 dst_rect.bottom = This->presentParms.BackBufferHeight;
481 if (!This->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO)
483 IWineD3DSurface_LoadLocation(This->backBuffer[0], SFLAG_INTEXTURE, NULL);
484 IWineD3DSurface_ModifyLocation(This->backBuffer[0], SFLAG_INDRAWABLE, FALSE);
485 This->render_to_fbo = TRUE;
491 if(This->render_to_fbo)
493 /* This codepath should only be hit with the COPY swapeffect. Otherwise a backbuffer-
500 if(This->presentParms.SwapEffect == WINED3DSWAPEFFECT_FLIP )
505 swapchain_blit(This, context, &src_rect, &dst_rect);
509 if (This->device->numContexts > 1) wglFinish();
511 if (This->num_contexts > 1) wglFinish();
532 This->frames++;
534 if (time - This->prev_time > 1500) {
535 TRACE_(fps)("%p @ approx %.2ffps\n", This, 1000.0*This->frames/(time - This->prev_time));
536 This->prev_time = time;
537 This->frames = 0;
581 /* This is disabled, but the code left in for debug purposes.
597 if (FALSE && This->presentParms.SwapEffect == WINED3DSWAPEFFECT_DISCARD) {
600 IWineD3DDevice_Clear((IWineD3DDevice *)This->device, 0, NULL,
604 if(!This->render_to_fbo &&
605 ( ((IWineD3DSurfaceImpl *) This->frontBuffer)->Flags & SFLAG_INSYSMEM ||
606 ((IWineD3DSurfaceImpl *) This->backBuffer[0])->Flags & SFLAG_INSYSMEM ) ) {
610 IWineD3DSurfaceImpl *front = (IWineD3DSurfaceImpl *) This->frontBuffer;
611 IWineD3DSurfaceImpl *back = (IWineD3DSurfaceImpl *) This->backBuffer[0];
619 * This serves to update the emulated overlay, if any
622 IWineD3DSurface_ModifyLocation(This->frontBuffer, SFLAG_INDRAWABLE, TRUE);
629 IWineD3DSurface_ModifyLocation(This->frontBuffer, SFLAG_INDRAWABLE, TRUE);
635 if(This->presentParms.SwapEffect == WINED3DSWAPEFFECT_FLIP) {
636 IWineD3DSurface_ModifyLocation(This->backBuffer[0], SFLAG_INDRAWABLE, TRUE);
640 if (This->device->stencilBufferTarget)
642 if (This->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
643 || ((IWineD3DSurfaceImpl *)This->device->stencilBufferTarget)->Flags & SFLAG_DISCARD)
645 surface_modify_ds_location(This->device->stencilBufferTarget, SFLAG_DS_DISCARDED);
649 if (This->presentParms.PresentationInterval != WINED3DPRESENT_INTERVAL_IMMEDIATE
657 switch(This->presentParms.PresentationInterval) {
660 if(sync <= This->vSyncCounter) {
661 retval = GL_EXTCALL(glXWaitVideoSyncSGI(1, 0, &This->vSyncCounter));
663 This->vSyncCounter = sync;
667 if(sync <= This->vSyncCounter + 1) {
668 retval = GL_EXTCALL(glXWaitVideoSyncSGI(2, This->vSyncCounter & 0x1, &This->vSyncCounter));
670 This->vSyncCounter = sync;
674 if(sync <= This->vSyncCounter + 2) {
675 retval = GL_EXTCALL(glXWaitVideoSyncSGI(3, This->vSyncCounter % 0x3, &This->vSyncCounter));
677 This->vSyncCounter = sync;
681 if(sync <= This->vSyncCounter + 3) {
682 retval = GL_EXTCALL(glXWaitVideoSyncSGI(4, This->vSyncCounter & 0x3, &This->vSyncCounter));
684 This->vSyncCounter = sync;
688 FIXME("Unknown presentation interval %08x\n", This->presentParms.PresentationInterval);
713 static HRESULT IWineD3DBaseSwapChainImpl_PresentRtPerform(IWineD3DSwapChainImpl* This)
715 IWineD3DSurface *pBb = This->backBuffer[0];
716 HRESULT hr = IWineD3DSurface_Blt(pBb, NULL, This->presentRt, NULL, 0, NULL, 0);
723 hr = IWineD3DSwapChainImpl_Present((IWineD3DSwapChain*)This, NULL, NULL, NULL, NULL, 0);
733 HRESULT WINAPI IWineD3DBaseSwapChainImpl_Flush(IWineD3DSwapChain* This)
742 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl*)iface;
744 if (This->presentRt != surf)
757 if (This->presentRt)
759 IWineD3DSurfaceImpl *old = (IWineD3DSurfaceImpl*)This->presentRt;
762 IWineD3DSurface_Release(This->presentRt);
764 This->presentRt = surf;
768 return IWineD3DBaseSwapChainImpl_PresentRtPerform(This);
1098 * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new
1264 IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *) iface;
1270 TRACE("Creating a new context for swapchain %p, thread %d\n", This, GetCurrentThreadId());
1276 if (!(ctx = context_create(This, (IWineD3DSurfaceImpl *)This->frontBuffer, This->ds_format
1278 , This->device->pHgsmi
1289 newArray = HeapAlloc(GetProcessHeap(), 0, sizeof(*newArray) * (This->num_contexts + 1));
1292 context_destroy(This->device, ctx);
1295 memcpy(newArray, This->context, sizeof(*newArray) * This->num_contexts);
1296 HeapFree(GetProcessHeap(), 0, This->context);
1297 newArray[This->num_contexts] = ctx;
1298 This->context = newArray;
1299 This->num_contexts++;