summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp35
1 files changed, 14 insertions, 21 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
index 341fb69e4..fc1e85b21 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
@@ -240,16 +240,16 @@ void LayerTreeHostQt::didDeleteLayer(WebLayerID id)
void LayerTreeHostQt::performScheduledLayerFlush()
{
- m_webPage->layoutIfNeeded();
-
- if (!m_isValid)
- return;
-
#if USE(TILED_BACKING_STORE)
if (m_isSuspended || m_waitingForUIProcess)
return;
#endif
+ m_webPage->layoutIfNeeded();
+
+ if (!m_isValid)
+ return;
+
m_shouldSyncFrame = false;
flushPendingLayerChanges();
if (!m_shouldSyncFrame)
@@ -261,6 +261,7 @@ void LayerTreeHostQt::performScheduledLayerFlush()
}
m_webPage->send(Messages::LayerTreeHostProxy::DidRenderFrame());
+ m_waitingForUIProcess = true;
if (!m_notifyAfterScheduledLayerFlush)
return;
@@ -320,6 +321,8 @@ int64_t LayerTreeHostQt::adoptImageBackingStore(Image* image)
graphicsContext->drawImage(image, ColorSpaceDeviceRGB, IntPoint::zero());
}
+ // Qt uses BGRA internally, we swizzle to RGBA for OpenGL.
+ bitmap->swizzleRGB();
ShareableBitmap::Handle handle;
bitmap->createHandle(handle);
m_webPage->send(Messages::LayerTreeHostProxy::CreateDirectlyCompositedImage(key, handle));
@@ -368,12 +371,12 @@ void LayerTreeHostQt::paintContents(const WebCore::GraphicsLayer* graphicsLayer,
}
}
-bool LayerTreeHostQt::showDebugBorders() const
+bool LayerTreeHostQt::showDebugBorders(const WebCore::GraphicsLayer*) const
{
return m_webPage->corePage()->settings()->showDebugBorders();
}
-bool LayerTreeHostQt::showRepaintCounter() const
+bool LayerTreeHostQt::showRepaintCounter(const WebCore::GraphicsLayer*) const
{
return m_webPage->corePage()->settings()->showRepaintCounter();
}
@@ -398,22 +401,12 @@ void LayerTreeHostQt::removeTile(WebLayerID layerID, int tileID)
m_webPage->send(Messages::LayerTreeHostProxy::RemoveTileForLayer(layerID, tileID));
}
-void LayerTreeHostQt::setVisibleContentRectForLayer(int layerID, const WebCore::IntRect& rect)
-{
- WebGraphicsLayer* layer = WebGraphicsLayer::layerByID(layerID);
- if (!layer)
- return;
- FloatRect visibleRect(rect);
- layer->setVisibleContentRect(rect);
-}
-
void LayerTreeHostQt::setVisibleContentRectAndScale(const IntRect& rect, float scale)
{
- WebGraphicsLayer* layer = toWebGraphicsLayer(m_rootLayer.get());
- if (!layer)
- return;
- layer->setContentsScale(scale);
- toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRect(rect);
+ if (m_rootLayer) {
+ toWebGraphicsLayer(m_rootLayer.get())->setVisibleContentRectAndScale(rect, scale);
+ scheduleLayerFlush();
+ }
}
void LayerTreeHostQt::setVisibleContentRectTrajectoryVector(const FloatPoint& trajectoryVector)