Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2655ac5f
Commit
2655ac5f
authored
Jul 17, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Aliased texture could only be requested for aliased rendering mode.
parent
c8368cf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
5 deletions
+86
-5
font.c
dlls/dwrite/font.c
+16
-0
font.c
dlls/dwrite/tests/font.c
+70
-5
No files found.
dlls/dwrite/font.c
View file @
2655ac5f
...
...
@@ -104,6 +104,8 @@ struct dwrite_fonttable {
struct
dwrite_glyphrunanalysis
{
IDWriteGlyphRunAnalysis
IDWriteGlyphRunAnalysis_iface
;
LONG
ref
;
DWRITE_RENDERING_MODE
rendering_mode
;
};
#define GLYPH_BLOCK_SHIFT 8
...
...
@@ -2774,7 +2776,20 @@ static ULONG WINAPI glyphrunanalysis_Release(IDWriteGlyphRunAnalysis *iface)
static
HRESULT
WINAPI
glyphrunanalysis_GetAlphaTextureBounds
(
IDWriteGlyphRunAnalysis
*
iface
,
DWRITE_TEXTURE_TYPE
type
,
RECT
*
bounds
)
{
struct
dwrite_glyphrunanalysis
*
This
=
impl_from_IDWriteGlyphRunAnalysis
(
iface
);
FIXME
(
"(%p)->(%d %p): stub
\n
"
,
This
,
type
,
bounds
);
if
((
UINT32
)
type
>
DWRITE_TEXTURE_CLEARTYPE_3x1
)
{
memset
(
bounds
,
0
,
sizeof
(
*
bounds
));
return
E_INVALIDARG
;
}
if
((
type
==
DWRITE_TEXTURE_ALIASED_1x1
&&
This
->
rendering_mode
!=
DWRITE_RENDERING_MODE_ALIASED
)
||
(
type
==
DWRITE_TEXTURE_CLEARTYPE_3x1
&&
This
->
rendering_mode
==
DWRITE_RENDERING_MODE_ALIASED
))
{
memset
(
bounds
,
0
,
sizeof
(
*
bounds
));
return
S_OK
;
}
return
E_NOTIMPL
;
}
...
...
@@ -2819,6 +2834,7 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, IDWriteGly
analysis
->
IDWriteGlyphRunAnalysis_iface
.
lpVtbl
=
&
glyphrunanalysisvtbl
;
analysis
->
ref
=
1
;
analysis
->
rendering_mode
=
rendering_mode
;
*
ret
=
&
analysis
->
IDWriteGlyphRunAnalysis_iface
;
return
S_OK
;
...
...
dlls/dwrite/tests/font.c
View file @
2655ac5f
...
...
@@ -3384,28 +3384,49 @@ static void test_CreateRenderingParams(void)
static
void
test_CreateGlyphRunAnalysis
(
void
)
{
static
const
DWRITE_RENDERING_MODE
rendermodes
[]
=
{
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_RENDERING_MODE_GDI_CLASSIC
,
DWRITE_RENDERING_MODE_GDI_NATURAL
,
DWRITE_RENDERING_MODE_NATURAL
,
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
,
};
IDWriteGlyphRunAnalysis
*
analysis
;
IDWriteFactory
*
factory
;
DWRITE_GLYPH_RUN
run
;
IDWriteFontFace
*
face
;
UINT16
index
;
UINT16
glyph
;
FLOAT
advance
;
HRESULT
hr
;
UINT32
ch
;
RECT
rect
;
DWRITE_GLYPH_OFFSET
offset
;
DWRITE_GLYPH_METRICS
metrics
;
int
i
;
factory
=
create_factory
();
face
=
create_fontface
(
factory
);
ch
=
'A'
;
hr
=
IDWriteFontFace_GetGlyphIndices
(
face
,
&
ch
,
1
,
&
index
);
glyph
=
0
;
hr
=
IDWriteFontFace_GetGlyphIndices
(
face
,
&
ch
,
1
,
&
glyph
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
glyph
>
0
,
"got %u
\n
"
,
glyph
);
hr
=
IDWriteFontFace_GetDesignGlyphMetrics
(
face
,
&
glyph
,
1
,
&
metrics
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
advance
=
metrics
.
advanceWidth
;
offset
.
advanceOffset
=
0
.
0
;
offset
.
ascenderOffset
=
0
.
0
;
run
.
fontFace
=
face
;
run
.
fontEmSize
=
24
.
0
;
run
.
glyphCount
=
1
;
run
.
glyphIndices
=
&
index
;
run
.
glyphIndices
=
&
glyph
;
run
.
glyphAdvances
=
&
advance
;
run
.
glyphOffsets
=
NULL
;
run
.
glyphOffsets
=
&
offset
;
run
.
isSideways
=
FALSE
;
run
.
bidiLevel
=
0
;
...
...
@@ -3422,11 +3443,55 @@ static void test_CreateGlyphRunAnalysis(void)
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_
GDI_CLASSIC
,
DWRITE_MEASURING_MODE_NATURAL
,
DWRITE_RENDERING_MODE_
ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* invalid texture type */
memset
(
&
rect
,
0xcc
,
sizeof
(
rect
));
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_CLEARTYPE_3x1
+
1
,
&
rect
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
rect
.
left
==
0
&&
rect
.
right
==
0
&&
rect
.
top
==
0
&&
rect
.
bottom
==
0
,
"unexpected rect
\n
"
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
for
(
i
=
0
;
i
<
sizeof
(
rendermodes
)
/
sizeof
(
rendermodes
[
0
]);
i
++
)
{
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
rendermodes
[
i
],
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
rendermodes
[
i
]
==
DWRITE_RENDERING_MODE_ALIASED
)
{
memset
(
&
rect
,
0
,
sizeof
(
rect
));
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_ALIASED_1x1
,
&
rect
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
IsRectEmpty
(
&
rect
),
"got empty rect
\n
"
);
}
rect
.
left
=
rect
.
top
=
0
;
rect
.
bottom
=
rect
.
right
=
1
;
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_CLEARTYPE_3x1
,
&
rect
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsRectEmpty
(
&
rect
),
"unexpected empty rect
\n
"
);
}
else
{
rect
.
left
=
rect
.
top
=
0
;
rect
.
bottom
=
rect
.
right
=
1
;
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_ALIASED_1x1
,
&
rect
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsRectEmpty
(
&
rect
),
"got empty rect
\n
"
);
memset
(
&
rect
,
0
,
sizeof
(
rect
));
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_CLEARTYPE_3x1
,
&
rect
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
IsRectEmpty
(
&
rect
),
"got empty rect
\n
"
);
}
}
IDWriteGlyphRunAnalysis_Release
(
analysis
);
}
IDWriteFontFace_Release
(
face
);
IDWriteFactory_Release
(
factory
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment