Lines Matching defs:surface

387 HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
417 surface->lpVtbl = &IWineD3DSurface_Vtbl;
422 surface->lpVtbl = &IWineGDISurface_Vtbl;
427 ERR("Requested unknown surface implementation %#x.\n", surface_type);
431 hr = resource_init((IWineD3DResource *)surface, WINED3DRTYPE_SURFACE,
446 * for the shared resource this will ensure the surface is initialized properly */
447 surface_shrc_lock(surface);
450 /* "Standalone" surface. */
451 IWineD3DSurface_SetContainer((IWineD3DSurface *)surface, NULL);
453 surface->currentDesc.Width = width;
454 surface->currentDesc.Height = height;
455 surface->currentDesc.MultiSampleType = multisample_type;
456 surface->currentDesc.MultiSampleQuality = multisample_quality;
457 surface->texture_level = level;
458 list_init(&surface->overlays);
461 surface->Flags = SFLAG_NORMCOORD; /* Default to normalized coords. */
463 if (pool == WINED3DPOOL_SYSTEMMEM && pvClientMem) surface->Flags |= SFLAG_CLIENTMEM;
465 if (discard) surface->Flags |= SFLAG_DISCARD;
466 if (lockable || format == WINED3DFMT_D16_LOCKABLE) surface->Flags |= SFLAG_LOCKABLE;
495 WARN("Creating a lockable surface with a POOL of DEFAULT, that doesn't specify DYNAMIC usage.\n");
509 surface_add_dirty_rect((IWineD3DSurface *)surface, NULL);
510 list_init(&surface->renderbuffers);
512 TRACE("surface %p, memory %p, size %u\n", surface, surface->resource.allocatedMemory, surface->resource.size);
515 hr = IWineD3DSurface_PrivateSetup((IWineD3DSurface *)surface);
519 cleanup(surface);
524 if (VBOXSHRC_IS_SHARED(surface))
528 if (!VBOXSHRC_IS_SHARED_OPENED(surface))
530 surface_shrc_unlock(surface);
532 *shared_handle = VBOXSHRC_GET_SHAREHANDLE(surface);
536 VBOXSHRC_UNLOCK(surface);
537 Assert(!VBOXSHRC_IS_LOCKED(surface));
541 surface_setup_location_onopen(surface);
543 Assert(*shared_handle == VBOXSHRC_GET_SHAREHANDLE(surface));
566 surface->presentSwapchain = NULL;
602 * surface has no texture name yet. See if we can get rid of this. */
776 * the surface pitch from being used to box non-power2 textures. Instead we have to use a hack to
826 TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", This, src_pitch, dst_pitch);
1035 TRACE("(%p) : Creating surface (target %#x) level %d, d3d format %s, internal format %#x, width %d, height %d, gl format %#x, gl type=%#x\n",
1047 * SFLAG_CONVERTED: The conversion destination memory is freed after loading the surface
1320 TRACE("(%p) : About to load surface\n", This);
1328 TRACE("Reloading surface because the d3d8/9 palette was changed\n");
1427 /* Load the surface into system memory */
1443 * all application-created targets the application has to release the surface
1478 /* Read the framebuffer back into the surface */
1505 /* Activate the surface. Set it up for blitting now, although not necessarily needed for LockRect.
1538 /* TODO: Get rid of the extra rectangle comparison and construction of a full surface rectangle */
1565 * Use GL_RGB, GL_UNSIGNED_BYTE to read the surface for performance reasons
1733 /* Activate the surface to read from. In some situations it isn't the currently active target(e.g. backbuffer
1779 /* If !SrcIsUpsideDown we should flip the surface.
1800 void surface_prepare_texture(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl_info, BOOL srgb)
1806 if (surface->Flags & alloc_flag) return;
1808 d3dfmt_get_conv(surface, TRUE, TRUE, &desc, &convert);
1809 if(convert != NO_CONVERSION) surface->Flags |= SFLAG_CONVERTED;
1810 else surface->Flags &= ~SFLAG_CONVERTED;
1812 surface_bind_and_dirtify(surface, srgb);
1813 surface_allocate_surface(surface, gl_info, &desc, srgb);
1814 surface->Flags |= alloc_flag;
1867 /* Performance optimization: Count how often a surface is locked, if it is locked regularly do not throw away the system memory copy.
1868 * This avoids the need to download the surface from opengl all the time. The surface is still downloaded if the opengl texture is
1929 /* Whatever surface we have, make sure that there is memory allocated for the downloaded copy,
1986 * the full surface. Most callers don't need that, so do it here. */
2015 ERR("The surface already has PBO memory allocated!\n");
2104 * glDrawPixels. If the surface is a DIB section, it might be in GDIMode
2124 /* When the surface is locked we only have to refresh the locked part else we need to update the whole image */
2231 * are written back to the drawable, thus the surface is merged again in the drawable. The sysmem copy is
2332 /* Can't GetDC if the surface is locked */
2352 /* Lock the surface */
2421 WARN("Application tries to release an invalid DC(%p), surface dc is %p\n", hDC, This->hDC);
2449 /* Copy the default values from the surface. Below we might perform fixups */
2564 /* In DirectDraw the palette is a property of the surface, there are no such things as device palettes. */
2591 TRACE("Using surface palette %p\n", pal);
2592 /* Get the surface's palette */
2678 on the same surface and disables color keying in such a case
2788 * Also the palette isn't interesting if the surface format isn't P8 or A8P8
2811 TRACE("Reloading because surface is dirty\n");
2822 * the surface. Make sure we have it
2830 TRACE("surface is already in texture\n");
2853 snprintf(buffer, sizeof(buffer), "/tmp/surface%p_type%u_level%u_%u.ppm",
2893 TRACE("(%p) : Binding surface\n", This);
2940 ERR("Mipmap surface has a glTexture bound to it!\n");
2964 so we should lock the surface before saving a snapshot, or at least check that
3116 /* Do I have to copy the old surface content? */
3137 /* Now the surface memory is most up do date. Invalidate drawable and texture */
3151 if(This->resource.heapMemory != NULL) ERR("User pointer surface has heap memory allocated\n");
3163 /* Flip the surface contents */
3186 /* Flip the surface data */
3246 WARN("Tried to flip a non-render target, non-overlay surface\n");
3271 ERR("Flipped surface is not on a swapchain\n");
3291 /* Flipping a OpenGL surface -> Use WineD3DDevice::Present */
3432 /* The texture is now most up to date - If the surface is a render target and has a drawable, this
3460 /* Activate the Proper context for reading from the source surface, set it up for blitting */
3604 /* draw the source texture stretched and upside down. The correct surface is bound already */
3706 /* The texture is now most up to date - If the surface is a render target and has a drawable, this
3734 /* Get the swapchain. One of the surfaces has to be a primary surface */
3753 TRACE("No surface is render target, not using hardware blit. Src = %p, dst = %p\n", Src, This);
3778 * Full surface size, no flags... Use present instead
3787 /* Source Rectangle must be full surface */
3801 /* Destination must be full surface or match the clipping rectangle */
3827 TRACE("No, dest rectangle doesn't match(surface size)\n");
3966 /* Blit from offscreen surface to render target */
3971 TRACE("Blt from surface %p to rendertarget %p\n", Src, This);
4003 * Just modify the color keying parameters in the surface and restore them afterwards
4004 * The surface keeps track of the color key last used to load the opengl surface.
4008 /* Use color key from surface */
4018 /* Now load the surface */
4027 * Also beware that the front buffer's surface size is screen width x screen height,
4115 /* TODO: If the surface is locked often, perform the Blt in software on the memory instead */
4116 /* The surface is now in the drawable. On onscreen surfaces or without fbos the texture
4299 /* Stick to the alignment for the converted surface too, makes it easier to load the surface */
4317 /* Stick to the alignment for the converted surface too, makes it easier to load the surface */
4388 TRACE("Attempt to access the depth stencil surface in a BeginScene / EndScene pair, returning WINED3DERR_INVALIDCALL\n");
4419 /* For the rest call the X11 surface implementation.
4451 TRACE("Attempt to access the depth stencil surface in a BeginScene / EndScene pair, returning WINED3DERR_INVALIDCALL\n");
4530 TRACE("Palette changed with surface that does not have an up to date system memory copy\n");
4533 TRACE("Dirtifying surface\n");
4608 4: Create the surface, but allow it to be used only for DirectDraw Blts. Some apps(e.g. Swat 3) create textures with a Height of 16 and a Width > 3000 and blt 16x16 letter areas from them to the render target.
4612 WARN("(%p) Unable to allocate a surface which exceeds the maximum OpenGL texture size\n", This);
4616 /* We should never use this surface in combination with OpenGL! */
4617 TRACE("(%p) Creating an oversized surface: %ux%u\n", This, This->pow2Width, This->pow2Height);
4621 /* Don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE
4847 TRACE("Surface %p is an onscreen surface\n", iface);
4864 * ogl texture backend assigned, e.g. when doing ColorFill right after surface creation
5003 * Copies the current surface data from wherever it is to the requested
5004 * location. The location is one of the surface flags, SFLAG_INSYSMEM,
5005 * SFLAG_INTEXTURE and SFLAG_INDRAWABLE. When the surface is current in
5043 TRACE("Surface %p is an onscreen surface\n", iface);
5070 /* Download the surface to system memory */
5114 TRACE("Removing the pbo attached to surface %p\n", This);
5125 /* Stick to the alignment for the converted surface too, makes it easier to load the surface */
5200 TRACE("Removing the pbo attached to surface %p\n", This);
5208 /* Stick to the alignment for the converted surface too, makes it easier to load the surface */
5223 /* Stick to the alignment for the converted surface too, makes it easier to load the surface */
5330 /* If there's no destination surface there is nothing to do */
5333 /* Blt calls ModifyLocation on the dest surface, which in turn calls DrawOverlay to
5444 static void ffp_blit_p8_upload_palette(IWineD3DSurfaceImpl *surface, const struct wined3d_gl_info *gl_info)
5447 BOOL colorkey_active = (surface->CKeyFlags & WINEDDSD_CKSRCBLT) ? TRUE : FALSE;
5449 d3dfmt_p8_init_palette(surface, table, colorkey_active);
5453 GL_EXTCALL(glColorTableEXT(surface->texture_target, GL_RGBA, 256, GL_RGBA, GL_UNSIGNED_BYTE, table));
5458 static HRESULT ffp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface)
5462 enum complex_fixup fixup = get_complex_fixup(surface->resource.format_desc->color_fixup);
5465 * else the surface is converted in software at upload time in LoadLocation.
5468 ffp_blit_p8_upload_palette(surface, gl_info);
5471 glEnable(surface->texture_target);
5472 checkGLcall("glEnable(surface->texture_target)");
5580 static HRESULT cpu_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface)