[cairo-bugs] [Bug 33178] Suggestions for cleaning HFONT handling

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 17 14:08:50 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33178

--- Comment #6 from Brent Fulgham <bfulgham at webkit.org> 2011-01-17 14:08:48 PST ---
(In reply to comment #5)

> draw_on (hdc1);
> cairo_win32_scaled_font_done_font (scaled_font);
> /*
> I can restore hdc1 here, but not hdc2.
> How does done_font know about this?
> */
> /* Restore *MUST* happen before destroying hdc1 */
> destroy(hdc1);
> 
> draw_on (hdc2);
> cairo_win32_scaled_font_done_font (scaled_font);
> /* Restoring here would be safe in this case, but we would never restore  */
> 
> How would you handle this case?

Ah!  You are totally right -- I didn't consider this case at all.

I agree with your points.
(1) Documentation update
(2) Correct the Cairo code to save/restore.

We can close this bug, unless you want to use it to track any of the other
changes you suggested.

Thanks for the quick review!

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the cairo-bugs mailing list