mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 18:28:03 +02:00
Simplify the implementation by taking advantage of the fact that destroy and reference are safe for NULL, and that reference returns its argument.
This commit is contained in:
parent
80b944418c
commit
417a66da5e
2 changed files with 9 additions and 5 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2005-08-05 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo-gstate.c: (_cairo_gstate_set_font_face): Simplify the
|
||||
implementation by taking advantage of the fact that destroy and
|
||||
reference are safe for NULL, and that reference returns its
|
||||
argument.
|
||||
|
||||
2005-08-05 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo-gstate.c: (_cairo_gstate_translate),
|
||||
|
|
|
|||
|
|
@ -1653,11 +1653,8 @@ _cairo_gstate_set_font_face (cairo_gstate_t *gstate,
|
|||
return font_face->status;
|
||||
|
||||
if (font_face != gstate->font_face) {
|
||||
if (gstate->font_face)
|
||||
cairo_font_face_destroy (gstate->font_face);
|
||||
gstate->font_face = font_face;
|
||||
if (gstate->font_face)
|
||||
cairo_font_face_reference (gstate->font_face);
|
||||
cairo_font_face_destroy (gstate->font_face);
|
||||
gstate->font_face = cairo_font_face_reference (font_face);
|
||||
}
|
||||
|
||||
_cairo_gstate_unset_scaled_font (gstate);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue