Bug 1383767 - add warning about unsupported recursive usage of gfxFT2LockedFace. r=me
authorLee Salzman <lsalzman@mozilla.com>
Thu, 27 Jul 2017 13:30:05 -0400
changeset 371561 ce44b4cc02e7816f291165d8edccb566c9447f76
parent 371560 b4cd32bc7d14f2ea97a7021a74ecddaf0311f82d
child 371562 f13dfb12254e979d067945061a87f515995e34a8
push id32250
push usercbook@mozilla.com
push dateFri, 28 Jul 2017 13:24:57 +0000
treeherdermozilla-central@16ffc1d05422 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1383767
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1383767 - add warning about unsupported recursive usage of gfxFT2LockedFace. r=me
gfx/thebes/gfxFT2Utils.h
--- a/gfx/thebes/gfxFT2Utils.h
+++ b/gfx/thebes/gfxFT2Utils.h
@@ -15,16 +15,23 @@
 // part and low 6 bits for the fractional part. 
 #define FLOAT_FROM_26_6(x) ((x) / 64.0)
 #define FLOAT_FROM_16_16(x) ((x) / 65536.0)
 #define ROUND_26_6_TO_INT(x) ((x) >= 0 ?  ((32 + (x)) >> 6) \
                                        : -((32 - (x)) >> 6))
 
 typedef struct FT_FaceRec_* FT_Face;
 
+/**
+ * BEWARE: Recursively locking with gfxFT2LockedFace is not supported.
+ * Do not instantiate gfxFT2LockedFace within the scope of another instance.
+ * Do not attempt to call into Cairo within the scope of gfxFT2LockedFace,
+ * as that may accidentally try to re-lock the face within Cairo itself
+ * and thus deadlock.
+ */
 class gfxFT2LockedFace {
 public:
     explicit gfxFT2LockedFace(gfxFT2FontBase *aFont) :
         mGfxFont(aFont),
         mFace(cairo_ft_scaled_font_lock_face(aFont->CairoScaledFont()))
     { }
     ~gfxFT2LockedFace()
     {