WebKit Bugzilla
Attachment 346007 Details for
Bug 188099
: [WIN] Fix tests for text with initial advances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188099-20180728184226.patch (text/plain), 4.64 KB, created by
Myles C. Maxfield
on 2018-07-28 18:42:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2018-07-28 18:42:27 PDT
Size:
4.64 KB
patch
obsolete
>Subversion Revision: 234345 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2775997bf44aca302fc91872ed2a5bed4044d9ef..d8dba936fe9fe1b1360a481c5e8a7ec03eb887ae 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-07-28 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [WIN] Fix tests for text with initial advances >+ https://bugs.webkit.org/show_bug.cgi?id=188099 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixup after r234318. >+ >+ Tests: fast/text/complex-first-glyph-with-initial-advance.html >+ fast/text/initial-advance-in-intermediate-run-complex.html >+ >+ * platform/graphics/ComplexTextController.cpp: >+ * platform/graphics/FontCascade.cpp: >+ (WebCore::FontCascade::drawGlyphBuffer const): >+ > 2018-07-28 Simon Fraser <simon.fraser@apple.com> > > Reset CompositingPolicyOverride between tests >diff --git a/Source/WebCore/platform/graphics/ComplexTextController.cpp b/Source/WebCore/platform/graphics/ComplexTextController.cpp >index 2e2bbbe2ea5c4e362dbe878549c07bc25797598c..a45323dd2a11673a7a3aa594a40f5448451ce281 100644 >--- a/Source/WebCore/platform/graphics/ComplexTextController.cpp >+++ b/Source/WebCore/platform/graphics/ComplexTextController.cpp >@@ -43,6 +43,29 @@ > > namespace WebCore { > >+#if PLATFORM(WIN) >+ >+class TextLayout { >+ WTF_MAKE_FAST_ALLOCATED; >+}; >+ >+void TextLayoutDeleter::operator()(TextLayout*) const >+{ >+} >+ >+std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText&, float, bool) const >+{ >+ return nullptr; >+} >+ >+float FontCascade::width(TextLayout&, unsigned, unsigned, HashSet<const Font*>*) >+{ >+ ASSERT_NOT_REACHED(); >+ return 0; >+} >+ >+#else >+ > class TextLayout { > WTF_MAKE_FAST_ALLOCATED; > public: >@@ -86,39 +109,19 @@ private: > > void TextLayoutDeleter::operator()(TextLayout* layout) const > { >-#if !PLATFORM(WIN) > delete layout; >-#else >- ASSERT_UNUSED(layout, !layout); >-#endif > } > > std::unique_ptr<TextLayout, TextLayoutDeleter> FontCascade::createLayout(RenderText& text, float xPos, bool collapseWhiteSpace) const > { >-#if !PLATFORM(WIN) > if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this)) > return nullptr; > return std::unique_ptr<TextLayout, TextLayoutDeleter>(new TextLayout(text, *this, xPos)); >-#else >- UNUSED_PARAM(text); >- UNUSED_PARAM(xPos); >- UNUSED_PARAM(collapseWhiteSpace); >- return nullptr; >-#endif > } > > float FontCascade::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const Font*>* fallbackFonts) > { >-#if !PLATFORM(WIN) > return layout.width(from, len, fallbackFonts); >-#else >- UNUSED_PARAM(layout); >- UNUSED_PARAM(from); >- UNUSED_PARAM(len); >- UNUSED_PARAM(fallbackFonts); >- ASSERT_NOT_REACHED(); >- return 0; >-#endif > } > > void ComplexTextController::computeExpansionOpportunity() >@@ -885,4 +888,6 @@ ComplexTextController::ComplexTextRun::ComplexTextRun(const Vector<FloatSize>& a > { > } > >+#endif >+ > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/FontCascade.cpp b/Source/WebCore/platform/graphics/FontCascade.cpp >index 932789461acf36a12dd158a8306bdf945505881a..d74db0afba50943f272e1d3f3e85994ed7a78cf8 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.cpp >+++ b/Source/WebCore/platform/graphics/FontCascade.cpp >@@ -1432,8 +1432,12 @@ void FontCascade::drawGlyphBuffer(GraphicsContext& context, const GlyphBuffer& g > { > // Draw each contiguous run of glyphs that use the same font data. > const Font* fontData = glyphBuffer.fontAt(0); >+#if PLATFORM(WIN) >+ FloatPoint startPoint(point.x() + glyphBuffer.initialAdvance().width(), point.y() + glyphBuffer.initialAdvance().height()); >+#else > // FIXME: Why do we subtract the initial advance's height but not its width??? > FloatPoint startPoint(point.x(), point.y() - glyphBuffer.initialAdvance().height()); >+#endif > float nextX = startPoint.x() + glyphBuffer.advanceAt(0).width(); > float nextY = startPoint.y() + glyphBuffer.advanceAt(0).height(); > unsigned lastFrom = 0; >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp >index 7595fe20e53c0426bf3664a7309319b7931a2ba6..9d2127fd2205a7ac9cd7baa4caa6b29875e915cb 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp >@@ -25,6 +25,8 @@ > > #include "config.h" > >+#if !PLATFORM(WIN) >+ > #include <JavaScriptCore/InitializeThreading.h> > #include <WebCore/ComplexTextController.h> > #include <WebCore/FontCascade.h> >@@ -365,3 +367,5 @@ TEST_F(ComplexTextControllerTest, TotalWidthWithJustification) > } > > } >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188099
:
345931
|
345961
|
345983
|
345988
|
345995
|
346007
|
346027
|
346184