Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cairo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
383
Issues
383
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cairo
cairo
Commits
e4a79db0
Commit
e4a79db0
authored
May 25, 2019
by
Matthias Clasen
Committed by
Behdad Esfahbod
Jul 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xlib compositor: Support subpixel positioning
As for the image compository, support a 4x4 subpixel grid.
parent
6fd4222a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
src/cairo-xlib-render-compositor.c
src/cairo-xlib-render-compositor.c
+13
-5
No files found.
src/cairo-xlib-render-compositor.c
View file @
e4a79db0
...
...
@@ -1074,8 +1074,7 @@ _cairo_xlib_glyph_fini (cairo_scaled_glyph_private_t *glyph_private,
to_free
->
count
=
0
;
}
to_free
->
indices
[
to_free
->
count
++
]
=
_cairo_scaled_glyph_index
(
glyph
);
to_free
->
indices
[
to_free
->
count
++
]
=
glyph
->
hash_entry
.
hash
;
}
cairo_list_del
(
&
glyph_private
->
link
);
...
...
@@ -1193,7 +1192,7 @@ _cairo_xlib_surface_add_glyph (cairo_xlib_display_t *display,
cairo_bool_t
already_had_glyph_surface
;
cairo_xlib_font_glyphset_t
*
info
;
glyph_index
=
_cairo_scaled_glyph_index
(
glyph
)
;
glyph_index
=
glyph
->
hash_entry
.
hash
;
/* check to see if we have a pending XRenderFreeGlyph for this glyph */
info
=
find_pending_free_glyph
(
display
,
font
,
glyph_index
,
glyph_surface
);
...
...
@@ -1570,6 +1569,9 @@ check_composite_glyphs (const cairo_composite_rectangles_t *extents,
* enough room for padding */
#define _cairo_sz_xGlyphElt (sz_xGlyphElt + 4)
#define PHASE(x) ((int)(floor (4 * (x + 0.125)) - 4 * floor (x + 0.125)))
#define POSITION(x) ((int) floor (x + 0.125))
static
cairo_int_status_t
composite_glyphs
(
void
*
surface
,
cairo_operator_t
op
,
...
...
@@ -1605,9 +1607,15 @@ composite_glyphs (void *surface,
op
=
_render_operator
(
op
),
_cairo_xlib_surface_ensure_picture
(
dst
);
for
(
i
=
0
;
i
<
num_glyphs
;
i
++
)
{
int
xphase
,
yphase
;
int
this_x
,
this_y
;
int
old_width
;
xphase
=
PHASE
(
glyphs
[
i
].
d
.
x
);
yphase
=
PHASE
(
glyphs
[
i
].
d
.
y
);
glyphs
[
i
].
index
|=
(
xphase
<<
24
)
|
(
yphase
<<
26
);
status
=
_cairo_scaled_glyph_lookup
(
info
->
font
,
glyphs
[
i
].
index
,
CAIRO_SCALED_GLYPH_INFO_METRICS
,
...
...
@@ -1615,8 +1623,8 @@ composite_glyphs (void *surface,
if
(
unlikely
(
status
))
return
status
;
this_x
=
_cairo_lround
(
glyphs
[
i
].
d
.
x
);
this_y
=
_cairo_lround
(
glyphs
[
i
].
d
.
y
);
this_x
=
POSITION
(
glyphs
[
i
].
d
.
x
);
this_y
=
POSITION
(
glyphs
[
i
].
d
.
y
);
/* Send unsent glyphs to the server */
if
(
glyph
->
dev_private_key
!=
display
)
{
...
...
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