1 /**************************************************************************
3 * Copyright 2009 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
27 **************************************************************************/
33 * @author Jose Fonseca <jfonseca@vmware.com>
39 #include "gdi_winsys.h"
40 #include "softpipe/sp_texture.h"
43 static struct pipe_screen
*
44 gdi_softpipe_screen_create(void)
46 static struct softpipe_winsys
*winsys
;
47 struct pipe_screen
*screen
;
49 winsys
= gdi_create_sw_winsys();
53 screen
= softpipe_create_screen(winsys
);
69 gdi_softpipe_present(struct pipe_screen
*screen
,
70 struct pipe_surface
*surface
,
73 struct softpipe_texture
*texture
;
74 struct gdi_softpipe_displaytarget
*gdt
;
76 texture
= softpipe_texture(surface
->texture
);
77 gdt
= gdi_softpipe_displaytarget(texture
->dt
);
80 0, 0, gdt
->width
, gdt
->height
,
81 0, 0, gdt
->width
, gdt
->height
,
82 gdt
->data
, &gdt
->bmi
, 0, SRCCOPY
);
86 static const struct stw_winsys stw_winsys
= {
87 &gdi_softpipe_screen_create
,
88 &gdi_softpipe_present
,
89 NULL
, /* get_adapter_luid */
90 NULL
, /* shared_surface_open */
91 NULL
, /* shared_surface_close */
97 DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpReserved
)
100 case DLL_PROCESS_ATTACH
:
101 stw_init(&stw_winsys
);
105 case DLL_THREAD_ATTACH
:
109 case DLL_THREAD_DETACH
:
110 stw_cleanup_thread();
113 case DLL_PROCESS_DETACH
:
114 stw_cleanup_thread();