diff options
author | Ben Murdoch <benm@google.com> | 2011-06-02 12:07:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-10 10:47:21 +0100 |
commit | 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch) | |
tree | e4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/platform/graphics/mac | |
parent | 87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff) | |
download | external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2 |
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/platform/graphics/mac')
4 files changed, 17 insertions, 13 deletions
diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextController.h b/Source/WebCore/platform/graphics/mac/ComplexTextController.h index 44a7994..281e49f 100644 --- a/Source/WebCore/platform/graphics/mac/ComplexTextController.h +++ b/Source/WebCore/platform/graphics/mac/ComplexTextController.h @@ -116,9 +116,6 @@ private: static OSStatus overrideLayoutOperation(ATSULayoutOperationSelector, ATSULineRef, URefCon, void*, ATSULayoutOperationCallbackStatus*); #endif -#if USE(CORE_TEXT) - RetainPtr<CTRunRef> m_coreTextRun; -#endif unsigned m_glyphCount; const SimpleFontData* m_fontData; const UChar* m_characters; @@ -159,6 +156,10 @@ private: Vector<UChar, 256> m_smallCapsBuffer; +#if USE(CORE_TEXT) + // Retain lines rather than their runs for better performance. + Vector<RetainPtr<CTLineRef> > m_coreTextLines; +#endif Vector<RefPtr<ComplexTextRun>, 16> m_complexTextRuns; Vector<CGSize, 256> m_adjustedAdvances; Vector<CGGlyph, 256> m_adjustedGlyphs; diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp b/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp index d2fbaf5..1473b1e 100644 --- a/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp +++ b/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp @@ -43,33 +43,32 @@ extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel; namespace WebCore { ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange) - : m_coreTextRun(ctRun) - , m_fontData(fontData) + : m_fontData(fontData) , m_characters(characters) , m_stringLocation(stringLocation) , m_stringLength(stringLength) , m_indexEnd(runRange.location + runRange.length) , m_isMonotonic(true) { - m_glyphCount = CTRunGetGlyphCount(m_coreTextRun.get()); - m_coreTextIndices = CTRunGetStringIndicesPtr(m_coreTextRun.get()); + m_glyphCount = CTRunGetGlyphCount(ctRun); + m_coreTextIndices = CTRunGetStringIndicesPtr(ctRun); if (!m_coreTextIndices) { m_coreTextIndicesVector.grow(m_glyphCount); - CTRunGetStringIndices(m_coreTextRun.get(), CFRangeMake(0, 0), m_coreTextIndicesVector.data()); + CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), m_coreTextIndicesVector.data()); m_coreTextIndices = m_coreTextIndicesVector.data(); } - m_glyphs = CTRunGetGlyphsPtr(m_coreTextRun.get()); + m_glyphs = CTRunGetGlyphsPtr(ctRun); if (!m_glyphs) { m_glyphsVector.grow(m_glyphCount); - CTRunGetGlyphs(m_coreTextRun.get(), CFRangeMake(0, 0), m_glyphsVector.data()); + CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), m_glyphsVector.data()); m_glyphs = m_glyphsVector.data(); } - m_advances = CTRunGetAdvancesPtr(m_coreTextRun.get()); + m_advances = CTRunGetAdvancesPtr(ctRun); if (!m_advances) { m_advancesVector.grow(m_glyphCount); - CTRunGetAdvances(m_coreTextRun.get(), CFRangeMake(0, 0), m_advancesVector.data()); + CTRunGetAdvances(ctRun, CFRangeMake(0, 0), m_advancesVector.data()); m_advances = m_advancesVector.data(); } } @@ -159,6 +158,8 @@ void ComplexTextController::collectComplexTextRunsForCharactersCoreText(const UC line.adoptCF(wkCreateCTLineWithUniCharProvider(&provideStringAndAttributes, 0, &info)); } + m_coreTextLines.append(line.get()); + CFArrayRef runArray = CTLineGetGlyphRuns(line.get()); CFIndex runCount = CFArrayGetCount(runArray); diff --git a/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm index 997c976..2a469a7 100644 --- a/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm +++ b/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm @@ -90,8 +90,8 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool) : m_currentWidth(0) , m_currentHeight(0) - , m_attrs(attrs) , m_contextObj(0) + , m_attrs(attrs) , m_texture(0) , m_compositorTexture(0) , m_fbo(0) diff --git a/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm index cd34000..f34d53b 100644 --- a/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm +++ b/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm @@ -241,6 +241,7 @@ void SimpleFontData::platformInit() NSString *familyName = [m_platformData.font() familyName]; if ([familyName isEqualToString:@"Times"] || [familyName isEqualToString:@"Helvetica"] || [familyName isEqualToString:@"Courier"]) ascent += floorf(((ascent + descent) * 0.15f) + 0.5f); +#if defined(BUILDING_ON_LEOPARD) else if ([familyName isEqualToString:@"Geeza Pro"]) { // Geeza Pro has glyphs that draw slightly above the ascent or far below the descent. Adjust // those vertical metrics to better match reality, so that diacritics at the bottom of one line @@ -248,6 +249,7 @@ void SimpleFontData::platformInit() ascent *= 1.08f; descent *= 2.f; } +#endif // Compute and store line spacing, before the line metrics hacks are applied. m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); |