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
18fe44c7
Commit
18fe44c7
authored
Jul 11, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Avoid repeated method calls during run rendering.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8810c88a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
font.c
dlls/dwrite/font.c
+2
-0
freetype.c
dlls/dwrite/freetype.c
+4
-7
No files found.
dlls/dwrite/dwrite_private.h
View file @
18fe44c7
...
...
@@ -260,6 +260,7 @@ extern WCHAR bidi_get_mirrored_char(WCHAR) DECLSPEC_HIDDEN;
/* FreeType integration */
struct
dwrite_glyphbitmap
{
IDWriteFontFace4
*
fontface
;
DWORD
simulations
;
FLOAT
emsize
;
BOOL
nohint
;
UINT16
index
;
...
...
dlls/dwrite/font.c
View file @
18fe44c7
...
...
@@ -4862,6 +4862,7 @@ static void glyphrunanalysis_get_texturebounds(struct dwrite_glyphrunanalysis *a
memset
(
&
glyph_bitmap
,
0
,
sizeof
(
glyph_bitmap
));
glyph_bitmap
.
fontface
=
fontface
;
glyph_bitmap
.
simulations
=
IDWriteFontFace4_GetSimulations
(
fontface
);
glyph_bitmap
.
emsize
=
analysis
->
run
.
fontEmSize
;
glyph_bitmap
.
nohint
=
is_natural_rendering_mode
(
analysis
->
rendering_mode
);
if
(
analysis
->
flags
&
RUNANALYSIS_USE_TRANSFORM
)
...
...
@@ -4954,6 +4955,7 @@ static HRESULT glyphrunanalysis_render(struct dwrite_glyphrunanalysis *analysis)
memset
(
&
glyph_bitmap
,
0
,
sizeof
(
glyph_bitmap
));
glyph_bitmap
.
fontface
=
fontface
;
glyph_bitmap
.
simulations
=
IDWriteFontFace4_GetSimulations
(
fontface
);
glyph_bitmap
.
emsize
=
analysis
->
run
.
fontEmSize
;
glyph_bitmap
.
nohint
=
is_natural_rendering_mode
(
analysis
->
rendering_mode
);
glyph_bitmap
.
type
=
analysis
->
texture_type
;
...
...
dlls/dwrite/freetype.c
View file @
18fe44c7
...
...
@@ -636,7 +636,6 @@ static BOOL is_face_scalable(IDWriteFontFace4 *fontface)
static
BOOL
get_glyph_transform
(
struct
dwrite_glyphbitmap
*
bitmap
,
FT_Matrix
*
ret
)
{
USHORT
simulations
=
IDWriteFontFace4_GetSimulations
(
bitmap
->
fontface
);
FT_Matrix
m
;
ret
->
xx
=
1
<<
16
;
...
...
@@ -646,10 +645,10 @@ static BOOL get_glyph_transform(struct dwrite_glyphbitmap *bitmap, FT_Matrix *re
/* Some fonts provide mostly bitmaps and very few outlines, for example for .notdef.
Disable transform if that's the case. */
if
(
!
is_face_scalable
(
bitmap
->
fontface
)
||
(
!
bitmap
->
m
&&
simulations
==
0
))
if
(
!
is_face_scalable
(
bitmap
->
fontface
)
||
(
!
bitmap
->
m
&&
bitmap
->
simulations
==
0
))
return
FALSE
;
if
(
simulations
&
DWRITE_FONT_SIMULATIONS_OBLIQUE
)
{
if
(
bitmap
->
simulations
&
DWRITE_FONT_SIMULATIONS_OBLIQUE
)
{
m
.
xx
=
1
<<
16
;
m
.
xy
=
(
1
<<
16
)
/
3
;
m
.
yx
=
0
;
...
...
@@ -667,7 +666,6 @@ static BOOL get_glyph_transform(struct dwrite_glyphbitmap *bitmap, FT_Matrix *re
void
freetype_get_glyph_bbox
(
struct
dwrite_glyphbitmap
*
bitmap
)
{
USHORT
simulations
=
IDWriteFontFace4_GetSimulations
(
bitmap
->
fontface
);
FTC_ImageTypeRec
imagetype
;
FT_BBox
bbox
=
{
0
};
BOOL
needs_transform
;
...
...
@@ -688,7 +686,7 @@ void freetype_get_glyph_bbox(struct dwrite_glyphbitmap *bitmap)
FT_Glyph
glyph_copy
;
if
(
pFT_Glyph_Copy
(
glyph
,
&
glyph_copy
)
==
0
)
{
if
(
simulations
&
DWRITE_FONT_SIMULATIONS_BOLD
)
if
(
bitmap
->
simulations
&
DWRITE_FONT_SIMULATIONS_BOLD
)
embolden_glyph
(
glyph_copy
,
bitmap
->
emsize
);
/* Includes oblique and user transform. */
...
...
@@ -826,7 +824,6 @@ static BOOL freetype_get_aa_glyph_bitmap(struct dwrite_glyphbitmap *bitmap, FT_G
BOOL
freetype_get_glyph_bitmap
(
struct
dwrite_glyphbitmap
*
bitmap
)
{
USHORT
simulations
=
IDWriteFontFace4_GetSimulations
(
bitmap
->
fontface
);
FTC_ImageTypeRec
imagetype
;
BOOL
needs_transform
;
BOOL
ret
=
FALSE
;
...
...
@@ -847,7 +844,7 @@ BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap)
if
(
needs_transform
)
{
if
(
pFT_Glyph_Copy
(
glyph
,
&
glyph_copy
)
==
0
)
{
if
(
simulations
&
DWRITE_FONT_SIMULATIONS_BOLD
)
if
(
bitmap
->
simulations
&
DWRITE_FONT_SIMULATIONS_BOLD
)
embolden_glyph
(
glyph_copy
,
bitmap
->
emsize
);
/* Includes oblique and user transform. */
...
...
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