Changeset 211308 in webkit
- Timestamp:
- Jan 27, 2017 3:56:58 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211305 r211308 1 2017-01-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] Prepare ComplexTextController for unit testing 4 https://bugs.webkit.org/show_bug.cgi?id=167493 5 6 Reviewed by Simon Fraser. 7 8 Addressing post-review comments from Simon Fraser. 9 10 * platform/graphics/FontCascade.h: 11 * platform/graphics/mac/ComplexTextController.h: 12 (WebCore::ComplexTextController::ComplexTextRun::createForTesting): 13 * platform/graphics/mac/ComplexTextControllerCoreText.h: 14 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): 15 1 16 2017-01-27 Simon Fraser <simon.fraser@apple.com> 2 17 -
trunk/Source/WebCore/platform/graphics/FontCascade.h
r211294 r211308 130 130 float size() const { return fontDescription().computedSize(); } 131 131 132 WEBCORE_EXPORT void update(RefPtr<FontSelector>&& ) const;132 WEBCORE_EXPORT void update(RefPtr<FontSelector>&& = nullptr) const; 133 133 134 134 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady }; -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h
r211294 r211308 92 92 } 93 93 94 static Ref<ComplexTextRun> createForTesting( Vector<CGSize> advances, Vector<CGPoint> origins, Vector<CGGlyph> glyphs, Vector<CFIndex>stringIndices, CGSize initialAdvance, const Font& font, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange, bool ltr)94 static Ref<ComplexTextRun> createForTesting(const Vector<CGSize>& advances, const Vector<CGPoint>& origins, const Vector<CGGlyph>& glyphs, const Vector<CFIndex>& stringIndices, CGSize initialAdvance, const Font& font, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange, bool ltr) 95 95 { 96 96 return adoptRef(*new ComplexTextRun(advances, origins, glyphs, stringIndices, initialAdvance, font, characters, stringLocation, stringLength, runRange, ltr)); … … 128 128 ComplexTextRun(CTRunRef, const Font&, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange); 129 129 ComplexTextRun(const Font&, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr); 130 WEBCORE_EXPORT ComplexTextRun( Vector<CGSize> advances, Vector<CGPoint> origins, Vector<CGGlyph> glyphs, Vector<CFIndex>stringIndices, CGSize initialAdvance, const Font&, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange, bool ltr);130 WEBCORE_EXPORT ComplexTextRun(const Vector<CGSize>& advances, const Vector<CGPoint>& origins, const Vector<CGGlyph>& glyphs, const Vector<CFIndex>& stringIndices, CGSize initialAdvance, const Font&, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange, bool ltr); 131 131 132 132 Vector<CGSize, 64> m_baseAdvancesVector; -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
r211294 r211308 184 184 185 185 186 ComplexTextController::ComplexTextRun::ComplexTextRun( Vector<CGSize> advances, Vector<CGPoint> origins, Vector<CGGlyph> glyphs, Vector<CFIndex>stringIndices, CGSize initialAdvance, const Font& font, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange, bool ltr)186 ComplexTextController::ComplexTextRun::ComplexTextRun(const Vector<CGSize>& advances, const Vector<CGPoint>& origins, const Vector<CGGlyph>& glyphs, const Vector<CFIndex>& stringIndices, CGSize initialAdvance, const Font& font, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange, bool ltr) 187 187 : m_baseAdvancesVector(advances) 188 188 , m_glyphOrigins(origins) -
trunk/Tools/ChangeLog
r211294 r211308 1 2017-01-27 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [Cocoa] Prepare ComplexTextController for unit testing 4 https://bugs.webkit.org/show_bug.cgi?id=167493 5 6 Reviewed by Simon Fraser. 7 8 Addressing post-review comments from Simon Fraser. 9 10 * TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp: 11 (TestWebKitAPI::TEST_F): 12 1 13 2017-01-27 Myles C. Maxfield <mmaxfield@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
r211294 r211308 52 52 description.setComputedSize(80); 53 53 FontCascade font(description); 54 font.update( nullptr);54 font.update(); 55 55 auto spaceWidth = font.primaryFont().spaceWidth(); 56 56 … … 68 68 size_t charactersLength = WTF_ARRAY_LENGTH(characters); 69 69 TextRun textRun(StringView(characters, charactersLength)); 70 Ref<ComplexTextController::ComplexTextRun>run1 = ComplexTextController::ComplexTextRun::createForTesting({ CGSizeMake(21.875, 0) }, { CGPointZero }, { 5 }, { 5 }, CGSizeZero, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(5, 1), false);71 Ref<ComplexTextController::ComplexTextRun>run2 = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 193, 377, 447, 431, 458 }, { 4, 3, 2, 1, 0 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 5), false);70 auto run1 = ComplexTextController::ComplexTextRun::createForTesting({ CGSizeMake(21.875, 0) }, { CGPointZero }, { 5 }, { 5 }, CGSizeZero, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(5, 1), false); 71 auto run2 = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 193, 377, 447, 431, 458 }, { 4, 3, 2, 1, 0 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 5), false); 72 72 Vector<Ref<ComplexTextController::ComplexTextRun>> runs; 73 73 runs.append(WTFMove(run1)); … … 103 103 description.setComputedSize(80); 104 104 FontCascade font(description); 105 font.update( nullptr);105 font.update(); 106 106 107 107 #if USE_LAYOUT_SPECIFIC_ADVANCES … … 118 118 size_t charactersLength = WTF_ARRAY_LENGTH(characters); 119 119 TextRun textRun(StringView(characters, charactersLength)); 120 Ref<ComplexTextController::ComplexTextRun>run = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 193, 377, 447, 431, 458 }, { 4, 3, 2, 1, 0 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 5), false);120 auto run = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 193, 377, 447, 431, 458 }, { 4, 3, 2, 1, 0 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 5), false); 121 121 Vector<Ref<ComplexTextController::ComplexTextRun>> runs; 122 122 runs.append(WTFMove(run)); … … 150 150 description.setComputedSize(80); 151 151 FontCascade font(description); 152 font.update( nullptr);152 font.update(); 153 153 auto spaceWidth = font.primaryFont().spaceWidth(); 154 154 … … 166 166 size_t charactersLength = WTF_ARRAY_LENGTH(characters); 167 167 TextRun textRun(StringView(characters, charactersLength)); 168 Ref<ComplexTextController::ComplexTextRun>run1 = ComplexTextController::ComplexTextRun::createForTesting({ CGSizeMake(spaceWidth, 0) }, { CGPointZero }, { 5 }, { 0 }, CGSizeZero, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 1), true);169 Ref<ComplexTextController::ComplexTextRun>run2 = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 68, 1471 }, { 1, 2 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(1, 2), true);168 auto run1 = ComplexTextController::ComplexTextRun::createForTesting({ CGSizeMake(spaceWidth, 0) }, { CGPointZero }, { 5 }, { 0 }, CGSizeZero, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 1), true); 169 auto run2 = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 68, 1471 }, { 1, 2 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(1, 2), true); 170 170 Vector<Ref<ComplexTextController::ComplexTextRun>> runs; 171 171 runs.append(WTFMove(run1)); … … 197 197 description.setComputedSize(80); 198 198 FontCascade font(description); 199 font.update( nullptr);199 font.update(); 200 200 201 201 #if USE_LAYOUT_SPECIFIC_ADVANCES … … 212 212 size_t charactersLength = WTF_ARRAY_LENGTH(characters); 213 213 TextRun textRun(StringView(characters, charactersLength)); 214 Ref<ComplexTextController::ComplexTextRun>run = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 68, 1471 }, { 0, 1 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 2), true);214 auto run = ComplexTextController::ComplexTextRun::createForTesting(advances, origins, { 68, 1471 }, { 0, 1 }, initialAdvance, font.primaryFont(), characters, 0, charactersLength, CFRangeMake(0, 2), true); 215 215 Vector<Ref<ComplexTextController::ComplexTextRun>> runs; 216 216 runs.append(WTFMove(run));
Note: See TracChangeset
for help on using the changeset viewer.