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
aa9827b0
Commit
aa9827b0
authored
Oct 19, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Oct 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move the string rendering code to a common function.
parent
e6c349d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
62 deletions
+44
-62
graphics.c
dlls/gdi32/dibdrv/graphics.c
+44
-62
No files found.
dlls/gdi32/dibdrv/graphics.c
View file @
aa9827b0
...
...
@@ -553,13 +553,49 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT aa_flags, GLYPHMETRICS
return
ERROR_SUCCESS
;
}
static
void
render_string
(
HDC
hdc
,
dib_info
*
dib
,
INT
x
,
INT
y
,
UINT
flags
,
UINT
aa_flags
,
const
WCHAR
*
str
,
UINT
count
,
const
INT
*
dx
,
DWORD
text_color
,
const
struct
intensity_range
*
ranges
,
const
struct
clipped_rects
*
clipped_rects
,
RECT
*
bounds
)
{
UINT
i
;
DWORD
err
;
GLYPHMETRICS
metrics
;
dib_info
glyph_dib
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
err
=
get_glyph_bitmap
(
hdc
,
(
UINT
)
str
[
i
],
aa_flags
,
&
metrics
,
&
glyph_dib
);
if
(
err
)
continue
;
if
(
glyph_dib
.
bits
.
ptr
)
draw_glyph
(
dib
,
x
,
y
,
&
metrics
,
&
glyph_dib
,
text_color
,
ranges
,
clipped_rects
,
bounds
);
free_dib_info
(
&
glyph_dib
);
if
(
dx
)
{
if
(
flags
&
ETO_PDY
)
{
x
+=
dx
[
i
*
2
];
y
+=
dx
[
i
*
2
+
1
];
}
else
x
+=
dx
[
i
];
}
else
{
x
+=
metrics
.
gmCellIncX
;
y
+=
metrics
.
gmCellIncY
;
}
}
}
BOOL
render_aa_text_bitmapinfo
(
HDC
hdc
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
,
struct
bitblt_coords
*
src
,
INT
x
,
INT
y
,
UINT
flags
,
UINT
aa_flags
,
LPCWSTR
str
,
UINT
count
,
const
INT
*
dx
)
{
dib_info
dib
;
UINT
i
;
DWORD
err
;
BOOL
got_pixel
;
COLORREF
fg
,
bg
;
DWORD
fg_pixel
,
bg_pixel
;
...
...
@@ -590,35 +626,8 @@ BOOL render_aa_text_bitmapinfo( HDC hdc, BITMAPINFO *info, struct gdi_image_bits
dib
.
funcs
->
solid_rects
(
&
dib
,
1
,
&
src
->
visrect
,
bkgnd_color
.
and
,
bkgnd_color
.
xor
);
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
GLYPHMETRICS
metrics
;
dib_info
glyph_dib
;
err
=
get_glyph_bitmap
(
hdc
,
(
UINT
)
str
[
i
],
aa_flags
,
&
metrics
,
&
glyph_dib
);
if
(
err
)
continue
;
if
(
glyph_dib
.
bits
.
ptr
)
draw_glyph
(
&
dib
,
x
,
y
,
&
metrics
,
&
glyph_dib
,
fg_pixel
,
glyph_intensities
,
&
visrect
,
NULL
);
free_dib_info
(
&
glyph_dib
);
if
(
dx
)
{
if
(
flags
&
ETO_PDY
)
{
x
+=
dx
[
i
*
2
];
y
+=
dx
[
i
*
2
+
1
];
}
else
x
+=
dx
[
i
];
}
else
{
x
+=
metrics
.
gmCellIncX
;
y
+=
metrics
.
gmCellIncY
;
}
}
render_string
(
hdc
,
&
dib
,
x
,
y
,
flags
,
aa_flags
,
str
,
count
,
dx
,
fg_pixel
,
glyph_intensities
,
&
visrect
,
NULL
);
return
TRUE
;
}
...
...
@@ -630,9 +639,9 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
struct
clipped_rects
clipped_rects
;
UINT
aa_flags
,
i
;
UINT
aa_flags
;
RECT
bounds
;
DWORD
text_color
,
err
;
DWORD
text_color
;
struct
intensity_range
ranges
[
17
];
init_clipped_rects
(
&
clipped_rects
);
...
...
@@ -667,35 +676,8 @@ BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
aa_flags
=
get_font_aa_flags
(
dev
->
hdc
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
GLYPHMETRICS
metrics
;
dib_info
glyph_dib
;
err
=
get_glyph_bitmap
(
dev
->
hdc
,
(
UINT
)
str
[
i
],
aa_flags
,
&
metrics
,
&
glyph_dib
);
if
(
err
)
continue
;
if
(
glyph_dib
.
bits
.
ptr
)
draw_glyph
(
&
pdev
->
dib
,
x
,
y
,
&
metrics
,
&
glyph_dib
,
text_color
,
ranges
,
&
clipped_rects
,
&
bounds
);
free_dib_info
(
&
glyph_dib
);
if
(
dx
)
{
if
(
flags
&
ETO_PDY
)
{
x
+=
dx
[
i
*
2
];
y
+=
dx
[
i
*
2
+
1
];
}
else
x
+=
dx
[
i
];
}
else
{
x
+=
metrics
.
gmCellIncX
;
y
+=
metrics
.
gmCellIncY
;
}
}
render_string
(
dev
->
hdc
,
&
pdev
->
dib
,
x
,
y
,
flags
,
aa_flags
,
str
,
count
,
dx
,
text_color
,
ranges
,
&
clipped_rects
,
&
bounds
);
done:
add_clipped_bounds
(
pdev
,
&
bounds
,
pdev
->
clip
);
...
...
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