Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a23b395e
Commit
a23b395e
authored
Oct 16, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use given ppdip factor in GetAlphaTextureBounds().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8b9e56cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
main.c
dlls/dwrite/main.c
+6
-1
font.c
dlls/dwrite/tests/font.c
+32
-0
No files found.
dlls/dwrite/main.c
View file @
a23b395e
...
@@ -1097,7 +1097,12 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *ifac
...
@@ -1097,7 +1097,12 @@ static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *ifac
TRACE
(
"(%p)->(%p %.2f %p %d %d %.2f %.2f %p)
\n
"
,
This
,
run
,
ppdip
,
transform
,
rendering_mode
,
TRACE
(
"(%p)->(%p %.2f %p %d %d %.2f %.2f %p)
\n
"
,
This
,
run
,
ppdip
,
transform
,
rendering_mode
,
measuring_mode
,
originX
,
originY
,
analysis
);
measuring_mode
,
originX
,
originY
,
analysis
);
return
create_glyphrunanalysis
(
rendering_mode
,
measuring_mode
,
run
,
1
.
0
f
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
if
(
ppdip
<=
0
.
0
f
)
{
*
analysis
=
NULL
;
return
E_INVALIDARG
;
}
return
create_glyphrunanalysis
(
rendering_mode
,
measuring_mode
,
run
,
ppdip
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE
,
originX
,
originY
,
analysis
);
DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE
,
originX
,
originY
,
analysis
);
}
}
...
...
dlls/dwrite/tests/font.c
View file @
a23b395e
...
@@ -3531,17 +3531,37 @@ static void test_CreateGlyphRunAnalysis(void)
...
@@ -3531,17 +3531,37 @@ static void test_CreateGlyphRunAnalysis(void)
run
.
isSideways
=
FALSE
;
run
.
isSideways
=
FALSE
;
run
.
bidiLevel
=
0
;
run
.
bidiLevel
=
0
;
/* zero ppdip */
analysis
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
0
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
analysis
==
NULL
,
"got %p
\n
"
,
analysis
);
/* negative ppdip */
analysis
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
-
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
analysis
==
NULL
,
"got %p
\n
"
,
analysis
);
/* default mode is not allowed */
/* default mode is not allowed */
analysis
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_DEFAULT
,
DWRITE_MEASURING_MODE_NATURAL
,
DWRITE_RENDERING_MODE_DEFAULT
,
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
analysis
==
NULL
,
"got %p
\n
"
,
analysis
);
/* outline too */
/* outline too */
analysis
=
(
void
*
)
0xdeadbeef
;
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_OUTLINE
,
DWRITE_MEASURING_MODE_NATURAL
,
DWRITE_RENDERING_MODE_OUTLINE
,
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
analysis
==
NULL
,
"got %p
\n
"
,
analysis
);
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
...
@@ -3562,6 +3582,18 @@ static void test_CreateGlyphRunAnalysis(void)
...
@@ -3562,6 +3582,18 @@ static void test_CreateGlyphRunAnalysis(void)
ok
(
!
IsRectEmpty
(
&
rect
),
"got empty rect
\n
"
);
ok
(
!
IsRectEmpty
(
&
rect
),
"got empty rect
\n
"
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
/* doubled ppdip */
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
2
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
0
.
0
,
0
.
0
,
&
analysis
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
memset
(
&
rect2
,
0
,
sizeof
(
rect2
));
hr
=
IDWriteGlyphRunAnalysis_GetAlphaTextureBounds
(
analysis
,
DWRITE_TEXTURE_ALIASED_1x1
,
&
rect2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
rect
.
right
-
rect
.
left
<
rect2
.
right
-
rect2
.
left
,
"expected wider rect
\n
"
);
ok
(
rect
.
bottom
-
rect
.
top
<
rect2
.
bottom
-
rect2
.
top
,
"expected taller rect
\n
"
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
10
.
0
,
-
5
.
0
,
&
analysis
);
10
.
0
,
-
5
.
0
,
&
analysis
);
...
...
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