diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-13 18:29:33 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-13 18:29:33 +0200 |
commit | 39a94d7c2c5d720ee6c8743b7315c7040afdaae1 (patch) | |
tree | 3163a177a6b26598b39ad1bd94aadb452746ab14 /Source/WebCore/platform | |
parent | ee8436b6ee3bb3742316b51d3b6bf4330f6c81b1 (diff) | |
parent | 6eecd106312582cacbfce3085e5a7b0b82778c92 (diff) |
Merge branch 'stable' into dev
Conflicts:
Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Change-Id: Iaa6209d0d611d18b8c916bcd165c8bf5b7441b7b
Diffstat (limited to 'Source/WebCore/platform')
4 files changed, 15 insertions, 9 deletions
diff --git a/Source/WebCore/platform/graphics/FontFastPath.cpp b/Source/WebCore/platform/graphics/FontFastPath.cpp index 22ce7f57e..d1553ea3f 100644 --- a/Source/WebCore/platform/graphics/FontFastPath.cpp +++ b/Source/WebCore/platform/graphics/FontFastPath.cpp @@ -335,13 +335,13 @@ float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int float totalWidth = it.m_runWidthSoFar; float beforeWidth = 0; int glyphPos = 0; - for (; glyphPos < localGlyphBuffer.size() && it.m_characterIndex[glyphPos] < from; ++glyphPos) + for (; glyphPos < localGlyphBuffer.size() && it.m_characterIndexOfGlyph[glyphPos] < from; ++glyphPos) beforeWidth += localGlyphBuffer.advanceAt(glyphPos); int glyphFrom = glyphPos; float afterWidth = totalWidth; glyphPos = localGlyphBuffer.size() - 1; - for (; glyphPos >= glyphFrom && it.m_characterIndex[glyphPos] >= to; --glyphPos) + for (; glyphPos >= glyphFrom && it.m_characterIndexOfGlyph[glyphPos] >= to; --glyphPos) afterWidth -= localGlyphBuffer.advanceAt(glyphPos); int glyphTo = glyphPos + 1; @@ -494,13 +494,13 @@ FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& float totalWidth = it.m_runWidthSoFar; float beforeWidth = 0; int glyphPos = 0; - for (; glyphPos < glyphBuffer.size() && it.m_characterIndex[glyphPos] < from; ++glyphPos) + for (; glyphPos < glyphBuffer.size() && it.m_characterIndexOfGlyph[glyphPos] < from; ++glyphPos) beforeWidth += glyphBuffer.advanceAt(glyphPos); int glyphFrom = glyphPos; float afterWidth = totalWidth; glyphPos = glyphBuffer.size() - 1; - for (; glyphPos >= glyphFrom && it.m_characterIndex[glyphPos] >= to; --glyphPos) + for (; glyphPos >= glyphFrom && it.m_characterIndexOfGlyph[glyphPos] >= to; --glyphPos) afterWidth -= glyphBuffer.advanceAt(glyphPos); // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning. @@ -525,7 +525,7 @@ int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool inclu characterOffset = run.length(); break; } - characterOffset = it.m_characterIndex[glyphPosition]; + characterOffset = it.m_characterIndexOfGlyph[glyphPosition]; float glyphWidth = glyphBuffer.advanceAt(glyphPosition); if (includePartialGlyphs) { if (currentX - glyphWidth / 2.0f <= x) @@ -543,7 +543,7 @@ int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool inclu characterOffset = run.length(); break; } - characterOffset = it.m_characterIndex[glyphPosition]; + characterOffset = it.m_characterIndexOfGlyph[glyphPosition]; float glyphWidth = glyphBuffer.advanceAt(glyphPosition); if (includePartialGlyphs) { if (currentX + glyphWidth / 2.0f >= x) diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp index 1fb1d9b40..7a1698d19 100644 --- a/Source/WebCore/platform/graphics/WidthIterator.cpp +++ b/Source/WebCore/platform/graphics/WidthIterator.cpp @@ -67,6 +67,8 @@ WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const else m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; } + // Character-index will end up the same or slightly shorter than m_run, so if we reserve that much it will never need to resize. + m_characterIndexOfGlyph.reserveInitialCapacity(m_run.length()); } GlyphData WidthIterator::glyphDataForCharacter(UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength) @@ -226,7 +228,7 @@ inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, Glyph if (glyphBuffer) { if (glyphBuffer->isEmpty()) { glyphBuffer->add(fontData->spaceGlyph(), fontData, expansionAtThisOpportunity); - m_characterIndex.append(currentCharacterIndex); + m_characterIndexOfGlyph.append(currentCharacterIndex); } else glyphBuffer->expandLastAdvance(expansionAtThisOpportunity); } @@ -295,7 +297,7 @@ inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, Glyph if (glyphBuffer) { glyphBuffer->add(glyph, fontData, (rtl ? oldWidth + lastRoundingWidth : width)); - m_characterIndex.append(currentCharacterIndex); + m_characterIndexOfGlyph.append(currentCharacterIndex); } lastRoundingWidth = width - oldWidth; diff --git a/Source/WebCore/platform/graphics/WidthIterator.h b/Source/WebCore/platform/graphics/WidthIterator.h index 43007e80d..8aa26782c 100644 --- a/Source/WebCore/platform/graphics/WidthIterator.h +++ b/Source/WebCore/platform/graphics/WidthIterator.h @@ -82,7 +82,8 @@ public: float m_expansionPerOpportunity; bool m_isAfterExpansion; float m_finalRoundingWidth; - Vector<int> m_characterIndex; + // An inline capacity of 10 catches around 2/3 of the cases. To catch 90% we would need 32. + Vector<int, 10> m_characterIndexOfGlyph; #if ENABLE(SVG_FONTS) String m_lastGlyphName; diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp index d2a10aa66..40243335b 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp @@ -400,6 +400,9 @@ void TextureMapperLayer::flushCompositingStateSelf(GraphicsLayerTextureMapper* g m_size = graphicsLayer->size(); + if ((changeMask & DrawsContentChange) && graphicsLayer->drawsContent()) + graphicsLayer->setNeedsDisplay(); + if (changeMask & MaskLayerChange) { if (TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer->maskLayer())) layer->m_effectTarget = this; |