Bug 1403167 - TextDrawTarget: fallback on partial ligatures. r?jrmuizel
MozReview-Commit-ID: BS4dsb0ndYU
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -18,16 +18,17 @@
#include "gfxScriptItemizer.h"
#include "nsUnicodeProperties.h"
#include "nsUnicodeRange.h"
#include "nsStyleConsts.h"
#include "mozilla/Likely.h"
#include "gfx2DGlue.h"
#include "mozilla/gfx/Logging.h" // for gfxCriticalError
#include "mozilla/UniquePtr.h"
+#include "TextDrawTarget.h"
#ifdef XP_WIN
#include "gfxWindowsPlatform.h"
#endif
#include "cairo.h"
using namespace mozilla;
@@ -468,16 +469,21 @@ gfxTextRun::DrawPartialLigature(gfxFont
gfxPoint *aPt, PropertyProvider *aProvider,
TextRunDrawParams& aParams,
gfx::ShapedTextFlags aOrientation) const
{
if (aRange.start >= aRange.end) {
return;
}
+ if (auto* textDrawer = aParams.context->GetTextDrawer()) {
+ textDrawer->FoundUnsupportedFeature();
+ return;
+ }
+
// Draw partial ligature. We hack this by clipping the ligature.
LigatureData data = ComputeLigatureData(aRange, aProvider);
gfxRect clipExtents = aParams.context->GetClipExtents();
gfxFloat start, end;
if (aParams.isVerticalRun) {
start = clipExtents.Y() * mAppUnitsPerDevUnit;
end = clipExtents.YMost() * mAppUnitsPerDevUnit;
ClipPartialLigature(this, &start, &end, aPt->y, &data);