diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /gfx/thebes/COLRFonts.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/COLRFonts.cpp')
-rw-r--r-- | gfx/thebes/COLRFonts.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gfx/thebes/COLRFonts.cpp b/gfx/thebes/COLRFonts.cpp index 6369bf191d..4a451f22d3 100644 --- a/gfx/thebes/COLRFonts.cpp +++ b/gfx/thebes/COLRFonts.cpp @@ -1298,8 +1298,7 @@ struct PaintGlyph { // Core Text's own color font support may step in and ignore the // pattern. So to avoid this, fill the glyph as a path instead. #if XP_MACOSX - RefPtr<Path> path = - aState.mScaledFont->GetPathForGlyphs(buffer, aState.mDrawTarget); + RefPtr<Path> path = GetPathForGlyphs(aState, buffer); aState.mDrawTarget->Fill(path, *fillPattern, aState.mDrawOptions); #else aState.mDrawTarget->FillGlyphs(aState.mScaledFont, buffer, *fillPattern, @@ -1307,8 +1306,7 @@ struct PaintGlyph { #endif return true; } - RefPtr<Path> path = - aState.mScaledFont->GetPathForGlyphs(buffer, aState.mDrawTarget); + RefPtr<Path> path = GetPathForGlyphs(aState, buffer); aState.mDrawTarget->PushClip(path); bool ok = DispatchPaint(aState, aOffset + paintOffset, aBounds); aState.mDrawTarget->PopClip(); @@ -1319,10 +1317,19 @@ struct PaintGlyph { MOZ_ASSERT(format == kFormat); Glyph g{uint16_t(glyphID), Point()}; GlyphBuffer buffer{&g, 1}; - RefPtr<Path> path = - aState.mScaledFont->GetPathForGlyphs(buffer, aState.mDrawTarget); + RefPtr<Path> path = GetPathForGlyphs(aState, buffer); return path->GetFastBounds(); } + + private: + RefPtr<Path> GetPathForGlyphs(const PaintState& aState, + const GlyphBuffer& buffer) const { + if (aState.mDrawTarget->GetBackendType() == BackendType::WEBRENDER_TEXT) { + RefPtr dt = gfxPlatform::ThreadLocalScreenReferenceDrawTarget(); + return aState.mScaledFont->GetPathForGlyphs(buffer, dt); + } + return aState.mScaledFont->GetPathForGlyphs(buffer, aState.mDrawTarget); + } }; struct PaintColrGlyph { |