[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
mitz at apple.com
mitz at apple.com
Wed Dec 22 15:43:34 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2b53bcee12c837338ac8b1e248fd8e807832423e
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 11 05:18:54 2010 +0000
Allow for the possibility of CoreText generating multiple runs for a single text run.
https://bugs.webkit.org/show_bug.cgi?id=49353
Patch by Ned Holbrook <nholbrook at apple.com> on 2010-11-10
Reviewed by Dan Bernstein.
* platform/graphics/mac/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::create):
* platform/graphics/mac/ComplexTextControllerCoreText.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
(WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 644e00d..d750ff8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-10 Ned Holbrook <nholbrook at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Allow for the possibility of CoreText generating multiple runs for a single text run.
+ https://bugs.webkit.org/show_bug.cgi?id=49353
+
+ * platform/graphics/mac/ComplexTextController.h:
+ (WebCore::ComplexTextController::ComplexTextRun::create):
+ * platform/graphics/mac/ComplexTextControllerCoreText.cpp:
+ (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
+ (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText):
+
2010-10-15 Martin Robinson <mrobinson at igalia.com>
Reviewed by Xan Lopez.
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.h b/WebCore/platform/graphics/mac/ComplexTextController.h
index 85407c7..885ff43 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.h
+++ b/WebCore/platform/graphics/mac/ComplexTextController.h
@@ -72,9 +72,9 @@ private:
class ComplexTextRun : public RefCounted<ComplexTextRun> {
public:
#if USE(CORE_TEXT)
- static PassRefPtr<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength)
+ static PassRefPtr<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, CFRange runRange)
{
- return adoptRef(new ComplexTextRun(ctRun, fontData, characters, stringLocation, stringLength));
+ return adoptRef(new ComplexTextRun(ctRun, fontData, characters, stringLocation, runRange));
}
#endif
#if USE(ATSUI)
@@ -102,7 +102,7 @@ private:
private:
#if USE(CORE_TEXT)
- ComplexTextRun(CTRunRef, const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength);
+ ComplexTextRun(CTRunRef, const SimpleFontData*, const UChar* characters, unsigned stringLocation, CFRange runRange);
void createTextRunFromFontDataCoreText(bool ltr);
#endif
#if USE(ATSUI)
diff --git a/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp b/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
index cbb7610..704a0e4 100644
--- a/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
@@ -41,19 +41,22 @@ extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel;
namespace WebCore {
-ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength)
+ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, CFRange runRange)
: m_coreTextRun(ctRun)
, m_fontData(fontData)
- , m_characters(characters)
- , m_stringLocation(stringLocation)
- , m_stringLength(stringLength)
+ , m_characters(characters + runRange.location)
+ , m_stringLocation(stringLocation + runRange.location)
+ , m_stringLength(runRange.length)
, m_isMonotonic(true)
{
m_glyphCount = CTRunGetGlyphCount(m_coreTextRun.get());
- m_coreTextIndices = CTRunGetStringIndicesPtr(m_coreTextRun.get());
+ m_coreTextIndices = runRange.location ? 0 : CTRunGetStringIndicesPtr(m_coreTextRun.get());
if (!m_coreTextIndices) {
m_coreTextIndicesVector.grow(m_glyphCount);
CTRunGetStringIndices(m_coreTextRun.get(), CFRangeMake(0, 0), m_coreTextIndicesVector.data());
+ if (runRange.location)
+ for (unsigned i = 0; i < m_glyphCount; ++i)
+ m_coreTextIndicesVector[i] -= runRange.location;
m_coreTextIndices = m_coreTextIndicesVector.data();
}
@@ -164,7 +167,8 @@ void ComplexTextController::collectComplexTextRunsForCharactersCoreText(const UC
for (CFIndex r = 0; r < runCount; r++) {
CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
- m_complexTextRuns.append(ComplexTextRun::create(ctRun, fontData, cp, stringLocation, length));
+ CFRange runRange = CTRunGetStringRange(ctRun);
+ m_complexTextRuns.append(ComplexTextRun::create(ctRun, fontData, cp, stringLocation, runRange));
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list