[Webkit-unassigned] [Bug 157066] REGRESSION(r200094): [FreeType] Vertical text is broken after r200094

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 27 09:19:08 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=157066

--- Comment #12 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to comment #9)
> Comment on attachment 277470 [details]
> Try to fix EFL build
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=277470&action=review

Thanks for the review!

> > 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.

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.

> > 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?

I followed the previous code, tried to cleanup everything but keeping the same behavior to avoid introducing new regressions.

> > 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.

I don't, it doesn't hurt either, though.

> > Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:-412
> > -    cairo_ft_scaled_font_unlock_face(m_scaledFont);
> 
> Wow. Really nice fix here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160427/91b3df2f/attachment.html>


More information about the webkit-unassigned mailing list