62 return id - glyph->
id;
84 IUnknown_AddRef(iface);
100 TRACE(
"%p increasing refcount to %lu.\n", iface,
ref);
110 TRACE(
"%p decreasing refcount to %lu.\n", iface,
ref);
114 for (
i = 0;
i <
font->texture_count; ++
i)
146 TRACE(
"iface %p, desc %p\n", iface,
desc);
159 TRACE(
"iface %p, desc %p\n", iface,
desc);
184 TRACE(
"iface %p\n", iface);
195 TRACE(
"iface %p, glyph %#x, texture %p, black_box %p, cell_inc %p.\n",
196 iface, glyph,
texture, black_box, cell_inc);
274 x = (
x ^ (
x >> 1)) & 0x33333333;
275 x = (
x ^ (
x >> 2)) & 0x0f0f0f0f;
276 x = (
x ^ (
x >> 4)) & 0x00ff00ff;
277 x = (
x ^ (
x >> 8)) & 0x0000ffff;
300 static const MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} };
302 IDirect3DTexture9 *current_texture =
NULL;
317 if (
font->texture_count)
318 current_texture =
font->textures[
font->texture_count - 1];
320 for (glyph =
first; glyph <=
last; ++glyph)
325 current_glyph =
malloc(
sizeof(*current_glyph));
333 current_glyph->
id = glyph;
340 WARN(
"GetGlyphOutlineW failed.\n");
356 if (
font->texture_pos ==
font->glyphs_per_texture)
358 unsigned int new_texture_count =
font->texture_count + 1;
359 IDirect3DTexture9 **new_textures;
364 new_textures =
realloc(
font->textures, new_texture_count *
sizeof(*new_textures));
370 font->textures = new_textures;
380 current_texture =
font->textures[
font->texture_count++];
381 font->texture_pos = 0;
404 current_glyph->
texture = current_texture;
406 pixel_data = lockrect.
pBits;
431 if (!
string && !
count)
439 wstr =
malloc(countW *
sizeof(*wstr));
460 if (!
string && !
count)
489 TRACE(
"iface %p, sprite %p, string %s, count %d, rect %s, format %#lx, color 0x%08lx.\n",
492 if (!
string || !
count)
500 wstr =
calloc(countW,
sizeof(*wstr));
515 unsigned int chars_fit,
unsigned int *chars_used,
SIZE *
size)
534 while (
i > 0 && !sla[
i].fSoftBreak)
538 if (!sla[
i].fSoftBreak)
542 if (sla[
i].fWhiteSpace)
546 while (
i > 0 && sla[
i-1].fWhiteSpace)
558 unsigned int orig_count = *
count;
566 if (
str[
i] !=
'\r' &&
str[
i] !=
'\n')
576 unsigned int chars_used;
579 *
count = orig_count - chars_used;
602 lh =
font->metrics.tmHeight;
607 unsigned int line_len;
611 if (
size.cx > max_width)
662 TRACE(
"iface %p, sprite %p, string %s, in_count %d, rect %s, format %#lx, color 0x%08lx.\n",
709 lh =
font->metrics.tmHeight;
720 unsigned int line_len,
i;
761 pos.y = cell_inc.
y +
y;
813 FIXME(
"iface %p stub!\n", iface);
819 FIXME(
"iface %p stub\n", iface);
858 desc.MipLevels=miplevels;
863 desc.PitchAndFamily=pitchandfamily;
865 else desc.FaceName[0] =
'\0';
880 desc.MipLevels=miplevels;
885 desc.PitchAndFamily=pitchandfamily;
887 else desc.FaceName[0] =
'\0';
935 object =
calloc(1,
sizeof(*
object));
944 object->desc = *
desc;
975 object->texture_size =
object->glyph_size;
976 if (
object->glyph_size < 256)
977 object->texture_size =
min(256,
object->texture_size * 16);
979 object->glyphs_per_texture =
object->texture_size *
object->texture_size
980 / (
object->glyph_size *
object->glyph_size);
981 object->texture_pos =
object->glyphs_per_texture;
984 *
font = &
object->ID3DXFont_iface;
static struct _test_info results[8]
static struct sockaddr_in sa
#define InterlockedIncrement
#define InterlockedDecrement
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define IDirect3DTexture9_AddRef(p)
#define IDirect3DDevice9_GetDirect3D(p, a)
#define IDirect3DTexture9_UnlockRect(p, a)
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
#define IDirect3DDevice9_GetCreationParameters(p, a)
#define IDirect3D9_Release(p)
#define IDirect3DDevice9_Release(p)
#define IDirect3DTexture9_LockRect(p, a, b, c, d)
#define IDirect3D9_CheckDeviceFormat(p, a, b, c, d, e, f)
#define IDirect3DTexture9_Release(p)
#define IDirect3DDevice9_AddRef(p)
#define IDirect3DDevice9_GetDisplayMode(p, a, b)
#define D3DXERR_INVALIDDATA
struct ID3DXFont ID3DXFont
HRESULT WINAPI D3DXCreateSprite(struct IDirect3DDevice9 *device, struct ID3DXSprite **sprite)
static uint32_t make_pow2(uint32_t num)
#define D3DERR_INVALIDCALL
static struct d3dx_font * impl_from_ID3DXFont(ID3DXFont *iface)
static uint32_t morton_decode(uint32_t x)
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
static HRESULT WINAPI ID3DXFontImpl_PreloadCharacters(ID3DXFont *iface, UINT first, UINT last)
static BOOL WINAPI ID3DXFontImpl_GetTextMetricsW(ID3DXFont *iface, TEXTMETRICW *metrics)
static HRESULT WINAPI ID3DXFontImpl_PreloadTextA(ID3DXFont *iface, const char *string, INT count)
static int compute_rect(struct d3dx_font *font, const WCHAR *string, unsigned int count, WCHAR *line, RECT *rect, DWORD format)
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite, const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
HRESULT WINAPI D3DXCreateFontW(IDirect3DDevice9 *device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality, DWORD pitchandfamily, const WCHAR *facename, ID3DXFont **font)
HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_DESCW *desc, ID3DXFont **font)
static HRESULT WINAPI ID3DXFontImpl_GetDescW(ID3DXFont *iface, D3DXFONT_DESCW *desc)
static HDC WINAPI ID3DXFontImpl_GetDC(ID3DXFont *iface)
HRESULT WINAPI D3DXCreateFontA(struct IDirect3DDevice9 *device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality, DWORD pitchandfamily, const char *facename, struct ID3DXFont **font)
static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid, void **out)
static HRESULT WINAPI ID3DXFontImpl_GetDescA(ID3DXFont *iface, D3DXFONT_DESCA *desc)
static void word_break(HDC hdc, const WCHAR *str, unsigned int *str_len, unsigned int chars_fit, unsigned int *chars_used, SIZE *size)
static BOOL WINAPI ID3DXFontImpl_GetTextMetricsA(ID3DXFont *iface, TEXTMETRICA *metrics)
HRESULT WINAPI D3DXCreateFontIndirectA(IDirect3DDevice9 *device, const D3DXFONT_DESCA *desc, ID3DXFont **font)
static HRESULT WINAPI ID3DXFontImpl_GetDevice(ID3DXFont *iface, IDirect3DDevice9 **device)
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite, const WCHAR *string, INT in_count, RECT *rect, DWORD format, D3DCOLOR color)
static HRESULT WINAPI ID3DXFontImpl_GetGlyphData(ID3DXFont *iface, UINT glyph, IDirect3DTexture9 **texture, RECT *black_box, POINT *cell_inc)
static int glyph_rb_compare(const void *key, const struct wine_rb_entry *entry)
static const ID3DXFontVtbl D3DXFont_Vtbl
static void glyph_rb_free(struct wine_rb_entry *entry, void *context)
static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *string, INT count)
static HRESULT WINAPI ID3DXFontImpl_OnResetDevice(ID3DXFont *iface)
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
static HRESULT WINAPI ID3DXFontImpl_PreloadGlyphs(ID3DXFont *iface, UINT first, UINT last)
static __inline const char * debugstr_an(const char *s, int n)
#define WideCharToMultiByte
#define MultiByteToWideChar
static void cleanup(void)
HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la)
#define ID3DXSprite_Release(p)
#define ID3DXFont_PreloadTextW(p, a, b)
#define ID3DXSprite_Begin(p, a)
#define ID3DXSprite_Draw(p, a, b, c, d, e)
#define ID3DXFont_GetGlyphData(p, a, b, c, d)
#define ID3DXFont_PreloadGlyphs(p, a, b)
#define ID3DXFont_DrawTextW(p, a, b, c, d, e, f)
#define ID3DXSprite_End(p)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLdouble GLdouble GLdouble GLdouble top
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLenum GLint GLint * precision
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
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define memcpy(s1, s2, n)
D3D11_SHADER_VARIABLE_DESC desc
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
unsigned __int3264 UINT_PTR
#define IsEqualGUID(rguid1, rguid2)
#define WINE_RB_ENTRY_VALUE
WCHAR FaceName[LF_FACESIZE]
unsigned int glyphs_per_texture
unsigned int texture_count
ID3DXFont ID3DXFont_iface
IDirect3DTexture9 ** textures
unsigned int texture_size
struct wine_rb_tree glyph_tree
IDirect3DDevice9 * device
IDirect3DTexture9 * texture
struct wine_rb_entry entry
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
DWORD WINAPI GetCharacterPlacementW(_In_ HDC hdc, _In_reads_(nCount) LPCWSTR lpString, _In_ int nCount, _In_ int nMexExtent, _Inout_ LPGCP_RESULTSW lpResults, _In_ DWORD dwFlags)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HFONT WINAPI CreateFontW(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR)
#define CLIP_DEFAULT_PRECIS
BOOL WINAPI GetTextExtentExPointW(_In_ HDC hdc, _In_reads_(cchString) LPCWSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
BOOL WINAPI DeleteDC(_In_ HDC)
DWORD WINAPI GetGlyphOutlineW(_In_ HDC hdc, _In_ UINT uChar, _In_ UINT fuFormat, _Out_ LPGLYPHMETRICS lpgm, _In_ DWORD cjBuffer, _Out_writes_bytes_opt_(cjBuffer) LPVOID pvBuffer, _In_ CONST MAT2 *lpmat2)