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
6d1f4790
Commit
6d1f4790
authored
Jul 31, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Translate rendered bitmap bounds to given origin.
parent
929ab3e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
7 deletions
+36
-7
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-1
font.c
dlls/dwrite/font.c
+9
-1
main.c
dlls/dwrite/main.c
+4
-4
font.c
dlls/dwrite/tests/font.c
+22
-1
No files found.
dlls/dwrite/dwrite_private.h
View file @
6d1f4790
...
...
@@ -124,7 +124,7 @@ extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *refer
extern
HRESULT
create_localfontfileloader
(
IDWriteLocalFontFileLoader
**
iface
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_fontface
(
DWRITE_FONT_FACE_TYPE
,
UINT32
,
IDWriteFontFile
*
const
*
,
UINT32
,
DWRITE_FONT_SIMULATIONS
,
IDWriteFontFace2
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_font_collection
(
IDWriteFactory2
*
,
IDWriteFontFileEnumerator
*
,
BOOL
,
IDWriteFontCollection
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_glyphrunanalysis
(
DWRITE_RENDERING_MODE
,
DWRITE_GLYPH_RUN
const
*
,
FLOAT
,
IDWriteGlyphRunAnalysis
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_glyphrunanalysis
(
DWRITE_RENDERING_MODE
,
DWRITE_GLYPH_RUN
const
*
,
FLOAT
,
FLOAT
,
FLOAT
,
IDWriteGlyphRunAnalysis
**
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_system_collection
(
IDWriteFontCollection
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_local_refkey
(
const
WCHAR
*
,
const
FILETIME
*
,
void
**
,
UINT32
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_filestream_from_file
(
IDWriteFontFile
*
,
IDWriteFontFileStream
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/font.c
View file @
6d1f4790
...
...
@@ -117,6 +117,8 @@ struct dwrite_glyphrunanalysis {
DWRITE_RENDERING_MODE
rendering_mode
;
DWRITE_GLYPH_RUN
run
;
FLOAT
ppdip
;
FLOAT
originX
;
FLOAT
originY
;
UINT16
*
glyphs
;
FLOAT
*
advances
;
DWRITE_GLYPH_OFFSET
*
offsets
;
...
...
@@ -2956,6 +2958,9 @@ static void glyphrunanalysis_get_texturebounds(struct dwrite_glyphrunanalysis *a
IDWriteFontFace2_Release
(
fontface2
);
/* translate to given run origin */
OffsetRect
(
&
analysis
->
bounds
,
analysis
->
originX
,
analysis
->
originY
);
analysis
->
ready
|=
RUNANALYSIS_BOUNDS
;
*
bounds
=
analysis
->
bounds
;
}
...
...
@@ -3075,7 +3080,8 @@ static const struct IDWriteGlyphRunAnalysisVtbl glyphrunanalysisvtbl = {
glyphrunanalysis_GetAlphaBlendParams
};
HRESULT
create_glyphrunanalysis
(
DWRITE_RENDERING_MODE
rendering_mode
,
DWRITE_GLYPH_RUN
const
*
run
,
FLOAT
ppdip
,
IDWriteGlyphRunAnalysis
**
ret
)
HRESULT
create_glyphrunanalysis
(
DWRITE_RENDERING_MODE
rendering_mode
,
DWRITE_GLYPH_RUN
const
*
run
,
FLOAT
ppdip
,
FLOAT
originX
,
FLOAT
originY
,
IDWriteGlyphRunAnalysis
**
ret
)
{
struct
dwrite_glyphrunanalysis
*
analysis
;
...
...
@@ -3094,6 +3100,8 @@ HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_GLY
analysis
->
rendering_mode
=
rendering_mode
;
analysis
->
ready
=
0
;
analysis
->
ppdip
=
ppdip
;
analysis
->
originX
=
originX
;
analysis
->
originY
=
originY
;
SetRectEmpty
(
&
analysis
->
bounds
);
analysis
->
run
=
*
run
;
IDWriteFontFace_AddRef
(
analysis
->
run
.
fontFace
);
...
...
dlls/dwrite/main.c
View file @
6d1f4790
...
...
@@ -1072,14 +1072,14 @@ static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory2 *if
static
HRESULT
WINAPI
dwritefactory_CreateGlyphRunAnalysis
(
IDWriteFactory2
*
iface
,
DWRITE_GLYPH_RUN
const
*
run
,
FLOAT
ppdip
,
DWRITE_MATRIX
const
*
transform
,
DWRITE_RENDERING_MODE
rendering_mode
,
DWRITE_MEASURING_MODE
measuring_mode
,
FLOAT
baseline_x
,
FLOAT
baseline_y
,
IDWriteGlyphRunAnalysis
**
analysis
)
DWRITE_MEASURING_MODE
measuring_mode
,
FLOAT
originX
,
FLOAT
originY
,
IDWriteGlyphRunAnalysis
**
analysis
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory2
(
iface
);
TRACE
(
"(%p)->(%p %.2f %p %d %d %
f %
f %p)
\n
"
,
This
,
run
,
ppdip
,
transform
,
rendering_mode
,
measuring_mode
,
baseline_x
,
baseline_y
,
analysis
);
TRACE
(
"(%p)->(%p %.2f %p %d %d %
.2f %.2
f %p)
\n
"
,
This
,
run
,
ppdip
,
transform
,
rendering_mode
,
measuring_mode
,
originX
,
originY
,
analysis
);
return
create_glyphrunanalysis
(
rendering_mode
,
run
,
ppdip
,
analysis
);
return
create_glyphrunanalysis
(
rendering_mode
,
run
,
ppdip
,
originX
,
originY
,
analysis
);
}
static
HRESULT
WINAPI
dwritefactory1_GetEudcFontCollection
(
IDWriteFactory2
*
iface
,
IDWriteFontCollection
**
collection
,
...
...
dlls/dwrite/tests/font.c
View file @
6d1f4790
...
...
@@ -3435,7 +3435,7 @@ static void test_CreateGlyphRunAnalysis(void)
FLOAT
advance
;
HRESULT
hr
;
UINT32
ch
;
RECT
rect
;
RECT
rect
,
rect2
;
DWRITE_GLYPH_OFFSET
offset
;
DWRITE_GLYPH_METRICS
metrics
;
DWRITE_FONT_METRICS
fm
;
...
...
@@ -3489,8 +3489,29 @@ static void test_CreateGlyphRunAnalysis(void)
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
"
);
/* check how origin affects bounds */
memset
(
&
rect
,
0
,
sizeof
(
rect
));
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
"
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
DWRITE_RENDERING_MODE_ALIASED
,
DWRITE_MEASURING_MODE_NATURAL
,
10
.
0
,
-
5
.
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
(
!
IsRectEmpty
(
&
rect2
),
"got empty rect
\n
"
);
IDWriteGlyphRunAnalysis_Release
(
analysis
);
ok
(
!
EqualRect
(
&
rect
,
&
rect2
),
"got equal bounds
\n
"
);
OffsetRect
(
&
rect
,
10
,
-
5
);
ok
(
EqualRect
(
&
rect
,
&
rect2
),
"got different bounds
\n
"
);
for
(
i
=
0
;
i
<
sizeof
(
rendermodes
)
/
sizeof
(
rendermodes
[
0
]);
i
++
)
{
hr
=
IDWriteFactory_CreateGlyphRunAnalysis
(
factory
,
&
run
,
1
.
0
,
NULL
,
rendermodes
[
i
],
DWRITE_MEASURING_MODE_NATURAL
,
...
...
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