Lines Matching refs:This

15  * This library is free software; you can redistribute it and/or
20 * This library is distributed in the hope that it will be useful,
105 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
107 TRACE("(%p)->(%s,%p)\n", This,debugstr_guid(riid),ppobj);
114 *ppobj = This;
122 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
123 ULONG ref = InterlockedIncrement(&This->resource.ref);
124 TRACE("(%p) : AddRef increasing from %d\n", This,ref - 1);
166 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
169 TRACE("(This %p, riid %s, ppContainer %p)\n", This, debugstr_guid(riid), ppContainer);
176 if (This->container) container = This->container;
177 else container = (IWineD3DBase *)This->resource.device;
184 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
186 TRACE("(%p) : copying into %p\n", This, pDesc);
188 pDesc->format = This->resource.format_desc->format;
189 pDesc->resource_type = This->resource.resourceType;
190 pDesc->usage = This->resource.usage;
191 pDesc->pool = This->resource.pool;
192 pDesc->size = This->resource.size; /* dx8 only */
193 pDesc->multisample_type = This->currentDesc.MultiSampleType;
194 pDesc->multisample_quality = This->currentDesc.MultiSampleQuality;
195 pDesc->width = This->currentDesc.Width;
196 pDesc->height = This->currentDesc.Height;
231 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
232 TRACE("(%p)\n", This);
235 return This->Flags & SFLAG_LOST ? WINED3DERR_DEVICELOST : WINED3D_OK;
239 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
240 TRACE("(%p)\n", This);
243 This->Flags &= ~SFLAG_LOST;
248 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
250 TRACE("(%p)->(%p)\n", This, Pal);
252 if(This->palette == PalImpl) {
257 if(This->palette != NULL)
258 if(This->resource.usage & WINED3DUSAGE_RENDERTARGET)
259 This->palette->Flags &= ~WINEDDPCAPS_PRIMARYSURFACE;
261 This->palette = PalImpl;
264 if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) {
275 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
276 TRACE("(%p)->(%08x,%p)\n", This, Flags, CKey);
287 This->DestBltCKey = *CKey;
288 This->CKeyFlags |= WINEDDSD_CKDESTBLT;
292 This->DestOverlayCKey = *CKey;
293 This->CKeyFlags |= WINEDDSD_CKDESTOVERLAY;
297 This->SrcOverlayCKey = *CKey;
298 This->CKeyFlags |= WINEDDSD_CKSRCOVERLAY;
302 This->SrcBltCKey = *CKey;
303 This->CKeyFlags |= WINEDDSD_CKSRCBLT;
310 This->CKeyFlags &= ~WINEDDSD_CKDESTBLT;
314 This->CKeyFlags &= ~WINEDDSD_CKDESTOVERLAY;
318 This->CKeyFlags &= ~WINEDDSD_CKSRCOVERLAY;
322 This->CKeyFlags &= ~WINEDDSD_CKSRCBLT;
331 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
332 TRACE("(%p)->(%p)\n", This, Pal);
334 *Pal = (IWineD3DPalette *) This->palette;
339 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
340 const struct wined3d_format_desc *format_desc = This->resource.format_desc;
342 TRACE("(%p)\n", This);
348 UINT row_block_count = (This->currentDesc.Width + format_desc->block_width - 1) / format_desc->block_width;
353 unsigned char alignment = This->resource.device->surface_alignment;
354 ret = This->resource.format_desc->byte_count * This->currentDesc.Width; /* Bytes / row */
357 TRACE("(%p) Returning %d\n", This, ret);
362 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
365 TRACE("(%p)->(%d,%d) Stub!\n", This, X, Y);
367 if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
369 TRACE("(%p): Not an overlay surface\n", This);
373 w = This->overlay_destrect.right - This->overlay_destrect.left;
374 h = This->overlay_destrect.bottom - This->overlay_destrect.top;
375 This->overlay_destrect.left = X;
376 This->overlay_destrect.top = Y;
377 This->overlay_destrect.right = X + w;
378 This->overlay_destrect.bottom = Y + h;
386 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
389 TRACE("(%p)->(%p,%p)\n", This, X, Y);
391 if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
393 TRACE("(%p): Not an overlay surface\n", This);
396 if(This->overlay_dest == NULL) {
400 *X = This->overlay_destrect.left;
401 *Y = This->overlay_destrect.top;
410 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
414 if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
416 TRACE("(%p): Not an overlay surface\n", This);
426 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
428 TRACE("(%p)->(%p, %p, %p, %08x, %p)\n", This, SrcRect, Dst, DstRect, Flags, FX);
430 if(!(This->resource.usage & WINED3DUSAGE_OVERLAY))
432 WARN("(%p): Not an overlay surface\n", This);
435 WARN("(%p): Dest surface is NULL\n", This);
440 This->overlay_srcrect = *SrcRect;
442 This->overlay_srcrect.left = 0;
443 This->overlay_srcrect.top = 0;
444 This->overlay_srcrect.right = This->currentDesc.Width;
445 This->overlay_srcrect.bottom = This->currentDesc.Height;
449 This->overlay_destrect = *DstRect;
451 This->overlay_destrect.left = 0;
452 This->overlay_destrect.top = 0;
453 This->overlay_destrect.right = Dst ? Dst->currentDesc.Width : 0;
454 This->overlay_destrect.bottom = Dst ? Dst->currentDesc.Height : 0;
457 if(This->overlay_dest && (This->overlay_dest != Dst || Flags & WINEDDOVER_HIDE)) {
458 list_remove(&This->overlay_entry);
462 if(This->overlay_dest != Dst) {
463 This->overlay_dest = Dst;
464 list_add_tail(&Dst->overlays, &This->overlay_entry);
468 This->overlay_srcrect.left = 0; This->overlay_srcrect.top = 0;
469 This->overlay_srcrect.right = 0; This->overlay_srcrect.bottom = 0;
470 This->overlay_destrect.left = 0; This->overlay_destrect.top = 0;
471 This->overlay_destrect.right = 0; This->overlay_destrect.bottom = 0;
472 This->overlay_dest = NULL;
482 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
483 TRACE("(%p)->(%p)\n", This, clipper);
485 This->clipper = clipper;
491 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
492 TRACE("(%p)->(%p)\n", This, clipper);
494 *clipper = This->clipper;
502 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
504 TRACE("This %p, container %p\n", This, container);
508 TRACE("Setting container to %p from %p\n", container, This->container);
509 This->container = container;
515 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
517 &This->resource.device->adapter->gl_info);
519 if (This->resource.format_desc->format != WINED3DFMT_UNKNOWN)
521 FIXME("(%p) : The format of the surface must be WINED3DFORMAT_UNKNOWN\n", This);
525 TRACE("(%p) : Setting texture format to (%d,%s)\n", This, format, debug_d3dformat(format));
527 This->resource.size = surface_calculate_size(format_desc, This->resource.device->surface_alignment,
528 This->pow2Width, This->pow2Height);
530 This->Flags |= (WINED3DFMT_D16_LOCKABLE == format) ? SFLAG_LOCKABLE : 0;
532 This->resource.format_desc = format_desc;
534 TRACE("(%p) : Size %d, bytesPerPixel %d\n", This, This->resource.size, format_desc->byte_count);
540 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
541 const struct wined3d_format_desc *format_desc = This->resource.format_desc;
583 if( ((This->resource.size + 3) % sysInfo.dwPageSize) < 4) {
591 b_info->bmiHeader.biHeight = -This->currentDesc.Height -extraline;
592 b_info->bmiHeader.biSizeImage = ( This->currentDesc.Height + extraline) * IWineD3DSurface_GetPitch(iface);
603 switch (This->resource.format_desc->format)
643 This->dib.DIBsection = CreateDIBSection(ddc, b_info, usage, &This->dib.bitmap_data, 0 /* Handle */, 0 /* Offset */);
646 if (!This->dib.DIBsection) {
652 TRACE("DIBSection at : %p\n", This->dib.bitmap_data);
654 if(This->resource.allocatedMemory) {
655 memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->currentDesc.Height * IWineD3DSurface_GetPitch(iface));
657 /* This is to make LockRect read the gl Texture although memory is allocated */
658 This->Flags &= ~SFLAG_INSYSMEM;
660 This->dib.bitmap_size = b_info->bmiHeader.biSizeImage;
665 This->hDC = CreateCompatibleDC(0);
666 This->dib.holdbitmap = SelectObject(This->hDC, This->dib.DIBsection);
667 TRACE("using wined3d palette %p\n", This->palette);
668 SelectPalette(This->hDC,
669 This->palette ? This->palette->hpal : 0,
672 This->Flags |= SFLAG_DIBSECTION;
674 HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
675 This->resource.heapMemory = NULL;
966 * This is the main functionality of DirectDraw
976 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
986 TRACE("(%p)->(%p,%p,%p,%x,%p)\n", This, DestRect, Src, SrcRect, Flags, DDBltFx);
1005 if ( (This->Flags & SFLAG_LOCKED) || ((Src != NULL) && (Src->Flags & SFLAG_LOCKED)))
1016 /* First check for the validity of source / destination rectangles. This was
1032 if ((/*This->clipper == NULL*/ TRUE) && (DestRect) &&
1033 ((DestRect->bottom > This->currentDesc.Height)||(DestRect->bottom < 0) ||
1034 (DestRect->top > This->currentDesc.Height)||(DestRect->top < 0) ||
1035 (DestRect->left > This->currentDesc.Width) ||(DestRect->left < 0) ||
1036 (DestRect->right > This->currentDesc.Width) ||(DestRect->right < 0) ||
1049 (DestRect->top >= (int) This->currentDesc.Height) ||
1050 (DestRect->left >= (int) This->currentDesc.Width))) ||
1067 xdst.bottom = This->currentDesc.Height;
1069 xdst.right = This->currentDesc.Width;
1099 full_rect.right = This->currentDesc.Width;
1100 full_rect.bottom = This->currentDesc.Height;
1107 int clip_horiz = (DestRect->left < 0) || (DestRect->right > (int) This->currentDesc.Width );
1108 int clip_vert = (DestRect->top < 0) || (DestRect->bottom > (int) This->currentDesc.Height);
1123 if (DestRect->right > This->currentDesc.Width)
1125 xsrc.right -= (DestRect->right - (int) This->currentDesc.Width);
1126 xdst.right = (int) This->currentDesc.Width;
1136 if (DestRect->bottom > This->currentDesc.Height)
1138 xsrc.bottom -= (DestRect->bottom - (int) This->currentDesc.Height);
1139 xdst.bottom = (int) This->currentDesc.Height;
1144 (xdst.top >= (int) This->currentDesc.Height) ||
1145 (xdst.left >= (int) This->currentDesc.Width) ||
1156 if (Src == This)
1164 sEntry = This->resource.format_desc;
1169 dEntry = This->resource.format_desc;
1172 if (This->resource.format_desc->format != Src->resource.format_desc->format)
1208 if (!DestRect || Src == This)
1210 memcpy(dlock.pBits, slock.pBits, This->resource.size);
1215 bpp = This->resource.format_desc->byte_count;
1222 if (DestRect && Src != This)
1305 /* No stretching in either direction. This needs to be as
1310 if (Src != This || xdst.top < xsrc.top ||
1602 if (Src && Src != This) IWineD3DSurface_UnlockRect((IWineD3DSurface *) Src);
1611 * This is the software implementation of BltFast, as used by GDI surfaces
1612 * and as a fallback for OpenGL surfaces. This code is taken from the old
1629 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
1643 TRACE("(%p)->(%d,%d,%p,%p,%08x)\n", This,dstx,dsty,Src,rsrc,trans);
1656 if ((This->Flags & SFLAG_LOCKED) ||
1685 if (h > This->currentDesc.Height-dsty) h = This->currentDesc.Height-dsty;
1690 if (w > This->currentDesc.Width-dstx) w = This->currentDesc.Width-dstx;
1705 bpp = This->resource.format_desc->byte_count;
1708 if (Src == This)
1722 sbuf = This->resource.allocatedMemory + lock_src.top * pitch + lock_src.left * bpp;
1723 dbuf = This->resource.allocatedMemory + lock_dst.top * pitch + lock_dst.left * bpp;
1739 dEntry = This->resource.format_desc;
1752 if (Src->resource.format_desc->format != This->resource.format_desc->format)
1799 keylow = This->DestBltCKey.dwColorSpaceLowValue;
1800 keyhigh = This->DestBltCKey.dwColorSpaceHighValue;
1875 /* This is pretty easy, a line for line memcpy */
1884 if (Src == This)
1899 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
1902 This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
1904 if (!This->resource.allocatedMemory)
1906 ERR("Can't LockRect, This->resource.allocatedMemory is NULL\n");
1914 pLockedRect->pBits = This->resource.allocatedMemory;
1915 This->lockedRect.left = 0;
1916 This->lockedRect.top = 0;
1917 This->lockedRect.right = This->currentDesc.Width;
1918 This->lockedRect.bottom = This->currentDesc.Height;
1921 &This->lockedRect, This->lockedRect.left, This->lockedRect.top,
1922 This->lockedRect.right, This->lockedRect.bottom);
1926 const struct wined3d_format_desc *format_desc = This->resource.format_desc;
1935 pLockedRect->pBits = This->resource.allocatedMemory
1941 pLockedRect->pBits = This->resource.allocatedMemory +
1945 This->lockedRect.left = pRect->left;
1946 This->lockedRect.top = pRect->top;
1947 This->lockedRect.right = pRect->right;
1948 This->lockedRect.bottom = pRect->bottom;
1964 IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
1966 /* This should only be called for sysmem textures, it may be a good idea
1968 if (This->resource.pool != WINED3DPOOL_SYSTEMMEM)
1972 return This->resource.allocatedMemory;