summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-21 13:45:25 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-21 13:45:26 +0100
commit3855ff8a1238b652a859975a549e90a90fae5cb0 (patch)
tree018466f95788c3ed933b383f4d480be70593bc3f
parentba4c0fc7927b0fd6d2fa71aceda8136094581e2d (diff)
parentdef5fef7fbf7fedece54d52188f75a90616599a4 (diff)
downloadqtwebkit-3855ff8a1238b652a859975a549e90a90fae5cb0.tar.gz
Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I3df74c8b47ff6e3d668f8b2126e6145670327d73
-rw-r--r--Source/WebCore/platform/graphics/qt/FontQt.cpp16
-rw-r--r--Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp4
2 files changed, 13 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/qt/FontQt.cpp b/Source/WebCore/platform/graphics/qt/FontQt.cpp
index 3eead7e70..ab11c5199 100644
--- a/Source/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/FontQt.cpp
@@ -59,9 +59,11 @@ static const QString fromRawDataWithoutRef(const String& string, int start = 0,
return QString::fromRawData(reinterpret_cast<const QChar*>(string.characters() + start), len);
}
-static QTextLine setupLayout(QTextLayout* layout, const TextRun& style)
+static QTextLine setupLayout(QTextLayout* layout, const TextRun& style, bool shouldSetDirection)
{
- int flags = style.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
+ int flags = 0;
+ if (shouldSetDirection || style.directionalOverride())
+ flags |= style.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
if (style.expansion())
flags |= Qt::TextJustificationForced;
layout->setCacheEnabled(true);
@@ -187,7 +189,7 @@ public:
m_layout.setText(string);
m_layout.setRawFont(font.rawFont());
font.initFormatForTextLayout(&m_layout, run);
- m_line = setupLayout(&m_layout, run);
+ m_line = setupLayout(&m_layout, run, false);
}
float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
@@ -239,7 +241,7 @@ void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const Float
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, true);
const QPointF adjustedPoint(point.x(), point.y() - line.ascent());
QList<QGlyphRun> runs = line.glyphRuns(from, to - from);
@@ -263,7 +265,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, false);
float x1 = line.cursorToX(0);
float x2 = line.cursorToX(run.length());
float width = qAbs(x2 - x1);
@@ -279,7 +281,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, float position, bo
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, false);
return line.xToCursor(position);
}
@@ -291,7 +293,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint
QTextLayout layout(string);
layout.setRawFont(rawFont());
initFormatForTextLayout(&layout, run);
- QTextLine line = setupLayout(&layout, run);
+ QTextLine line = setupLayout(&layout, run, false);
float x1 = line.cursorToX(from);
float x2 = line.cursorToX(to);
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
index acd382cdb..b9709136d 100644
--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
@@ -694,6 +694,10 @@ void CoordinatedGraphicsScene::purgeGLResources()
m_backingStores.clear();
m_backingStoresWithPendingBuffers.clear();
+ LayerMap::iterator end = m_layers.end();
+ for (LayerMap::iterator it = m_layers.begin(); it != end; ++it)
+ it->value->setBackingStore(0);
+
setActive(false);
dispatchOnMainThread(bind(&CoordinatedGraphicsScene::purgeBackingStores, this));
}