<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION(r200094): [FreeType] Vertical text is broken after r200094"
href="https://bugs.webkit.org/show_bug.cgi?id=157066#c12">Comment # 12</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - REGRESSION(r200094): [FreeType] Vertical text is broken after r200094"
href="https://bugs.webkit.org/show_bug.cgi?id=157066">bug 157066</a>
from <span class="vcard"><a class="email" href="mailto:cgarcia@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=157066#c9">comment #9</a>)
<span class="quote">> Comment on <span class=""><a href="attachment.cgi?id=277470&action=diff" name="attach_277470" title="Try to fix EFL build">attachment 277470</a> <a href="attachment.cgi?id=277470&action=edit" title="Try to fix EFL build">[details]</a></span>
> Try to fix EFL build
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=277470&action=review">https://bugs.webkit.org/attachment.cgi?id=277470&action=review</a></span >
Thanks for the review!
<span class="quote">> > Source/WebCore/platform/graphics/cairo/CairoUtilities.h:64
> > +#if USE(FREETYPE)
> > +class CairoFtFaceLocker {
> > +public:
> > + CairoFtFaceLocker(cairo_scaled_font_t*);
> > + ~CairoFtFaceLocker();
> > +
> > + FT_Face ftFace() const { return m_ftFace; }
> > +
> > +private:
> > + cairo_scaled_font_t* m_scaledFont { nullptr };
> > + FT_Face m_ftFace { nullptr };
> > +};
>
> One note is that by not putting the implementation of the constructor and
> destructor here, it is impossible for the compiler to inline them. It might
> be better to avoid changing that.</span >
It was my initial idea to do the implementation in the header, but I wanted to avoid including cairo-ft header in the header file. I didn't know this prevented the compiler from inline the implementation.
<span class="quote">> > Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:253
> > + // We need to reinitialize the instance, because the difference in size
> > + // necessitates a new scaled font instance.
> > + ASSERT(copy.m_scaledFont.get());
> > + copy.buildScaledFont(cairo_scaled_font_get_font_face(copy.m_scaledFont.get()));
>
> Why don't you also check if the size is different here similar to the
> methods above?</span >
I followed the previous code, tried to cleanup everything but keeping the same behavior to avoid introducing new regressions.
<span class="quote">> > Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:291
> > - return m_scaledFont == other.m_scaledFont
> > - && m_size == other.m_size
> > - && m_syntheticOblique == other.m_syntheticOblique
> > - && m_orientation == other.m_orientation
> > - && m_syntheticBold == other.m_syntheticBold;
> > + return m_scaledFont == other.m_scaledFont;
> > }
>
> Yay!
>
> > Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:349
> > + ASSERT(m_scaledFont.get());
>
> I'm not sure you need .get() here.</span >
I don't, it doesn't hurt either, though.
<span class="quote">> > Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:-412
> > - cairo_ft_scaled_font_unlock_face(m_scaledFont);
>
> Wow. Really nice fix here.</span ></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>