5672 unsigned int i,
x,
y,
z;
5688 unsigned int bit_count;
5689 DWORD mask_r, mask_g, mask_b;
5717 if (!pD3DKMTCreateDCFromMemory)
5719 win_skip(
"D3DKMTCreateDCFromMemory() is not implemented.\n");
5732 create_desc.
Width = 9;
5734 create_desc.
Pitch =
sizeof(*data);
5737 create_desc.
hDc = (
void *)0x010baade;
5738 create_desc.
hBitmap = (
void *)0x020baade;
5740 status = pD3DKMTCreateDCFromMemory( &create_desc );
5746 status = pD3DKMTCreateDCFromMemory( &create_desc );
5752 status = pD3DKMTCreateDCFromMemory( &create_desc );
5755 ok(create_desc.
hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5757 ok(create_desc.
hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5761 create_desc.
Width = 0;
5762 status = pD3DKMTCreateDCFromMemory( &create_desc );
5767 destroy_desc.
hDc = create_desc.
hDc;
5769 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5771 create_desc.
hDc = (
void *)0x010baade;
5772 create_desc.
hBitmap = (
void *)0x020baade;
5775 create_desc.
Pitch = 0;
5776 status = pD3DKMTCreateDCFromMemory( &create_desc );
5779 ok(create_desc.
hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5781 ok(create_desc.
hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5784 create_desc.
Width = 9;
5785 create_desc.
Pitch =
sizeof(*data);
5786 status = pD3DKMTCreateDCFromMemory( &create_desc );
5791 ok(!!create_desc.
hDc,
"%s: Got unexpected dc %p.\n",
5793 ok(!!create_desc.
hBitmap,
"%s: Got unexpected bitmap %p.\n",
5798 ok(create_desc.
hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5800 ok(create_desc.
hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5810 ok(
bitmap == create_desc.
hBitmap,
"%s: Got unexpected bitmap %p, expected %p.\n",
5815 ok(!
dib.dsBm.bmType,
"%s: Got unexpected type %#x.\n",
5817 ok(
dib.dsBm.bmWidth == create_desc.
Width,
"%s: Got unexpected width %d.\n",
5819 ok(
dib.dsBm.bmHeight == create_desc.
Height,
"%s: Got unexpected height %d.\n",
5822 ok(
dib.dsBm.bmWidthBytes ==
width_bytes,
"%s: Got unexpected width bytes %d.\n",
5824 ok(
dib.dsBm.bmPlanes == 1,
"%s: Got unexpected plane count %d.\n",
5826 ok(
dib.dsBm.bmBitsPixel ==
test_data[
i].bit_count,
"%s: Got unexpected bit count %d.\n",
5828 ok(
dib.dsBm.bmBits == create_desc.
pMemory,
"%s: Got unexpected bits %p, expected %p.\n",
5831 ok(
dib.dsBmih.biSize ==
sizeof(
dib.dsBmih),
"%s: Got unexpected size %u.\n",
5833 ok(
dib.dsBmih.biWidth == create_desc.
Width,
"%s: Got unexpected width %d.\n",
5835 ok(
dib.dsBmih.biHeight == create_desc.
Height,
"%s: Got unexpected height %d.\n",
5837 ok(
dib.dsBmih.biPlanes == 1,
"%s: Got unexpected plane count %u.\n",
5839 ok(
dib.dsBmih.biBitCount ==
test_data[
i].bit_count,
"%s: Got unexpected bit count %u.\n",
5842 "%s: Got unexpected compression %#x.\n",
5844 ok(!
dib.dsBmih.biSizeImage,
"%s: Got unexpected image size %u.\n",
5846 ok(!
dib.dsBmih.biXPelsPerMeter,
"%s: Got unexpected horizontal resolution %d.\n",
5848 ok(!
dib.dsBmih.biYPelsPerMeter,
"%s: Got unexpected vertical resolution %d.\n",
5852 ok(
dib.dsBmih.biClrUsed == 256,
"%s: Got unexpected used colour count %u.\n",
5854 ok(
dib.dsBmih.biClrImportant == 256,
"%s: Got unexpected important colour count %u.\n",
5859 ok(!
dib.dsBmih.biClrUsed,
"%s: Got unexpected used colour count %u.\n",
5861 ok(!
dib.dsBmih.biClrImportant,
"%s: Got unexpected important colour count %u.\n",
5867 "%s: Got unexpected colour masks 0x%08x 0x%08x 0x%08x.\n",
5869 ok(!
dib.dshSection,
"%s: Got unexpected section %p.\n",
test_data[
i].name,
dib.dshSection);
5870 ok(!
dib.dsOffset,
"%s: Got unexpected offset %u.\n",
test_data[
i].name,
dib.dsOffset);
5873 ok(
ret,
"Failed to blit.\n");
5875 ok(
ret,
"Failed to blit.\n");
5879 ok(bmp_dc !=
NULL,
"failed to create DC\n");
5881 ok(
bmp !=
NULL,
"failed to create bmp\n");
5884 ok(
ret,
"Failed to blit.\n");
5886 destroy_desc.
hDc = create_desc.
hDc;
5891 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5893 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5897 ok(
ret,
"Failed to delete dc.\n");
5899 for (
y = 0, fail =
FALSE;
y < 12 && !fail; ++
y)
5901 for (
x = 0;
x <
sizeof(*data) / (
test_data[
i].bit_count / 8) && !fail; ++
x)
5903 for (
z = 0, colour = 0;
z <
test_data[
i].bit_count / 8; ++
z)
5908 if ((
x == 1 ||
x == 2) && (
y == 1 ||
y == 2))
5910 else if (
x < 4 &&
y < 7)
5914 ok(colour ==
expected,
"%s: Got unexpected colour 0x%08x at %u, %u, expected 0x%08x.\n",
5923 if ((
x == 1 ||
x == 2) && (
y == 1 ||
y == 2))
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
static int get_dib_stride(int width, int bpp)
#define STATUS_INVALID_PARAMETER
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static struct _test_data test_data[]
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
PALETTEENTRY * pColorTable
HBITMAP WINAPI CreateCompatibleBitmap(HDC hDC, INT Width, INT Height)
enum _D3DDDIFORMAT D3DDDIFORMAT
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
BOOL WINAPI DeleteDC(_In_ HDC)
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei GLenum type
static SERVICE_STATUS status
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLuint const GLchar * name