summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/CoordinatedGraphics
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
commit5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch)
tree8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebKit2/UIProcess/CoordinatedGraphics
parent33b26980cb24288b5a9f2590ccf32a949281bb79 (diff)
downloadqtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebKit2/UIProcess/CoordinatedGraphics')
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp10
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp24
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h9
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in6
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp24
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h8
6 files changed, 48 insertions, 33 deletions
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp
index 84f6ebd2f..77fdc0a26 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp
@@ -80,15 +80,15 @@ void CoordinatedBackingStore::updateTile(int id, const IntRect& sourceRect, cons
{
HashMap<int, CoordinatedBackingStoreTile>::iterator it = m_tiles.find(id);
ASSERT(it != m_tiles.end());
- it->second.incrementRepaintCount();
- it->second.setBackBuffer(targetRect, sourceRect, backBuffer, offset);
+ it->value.incrementRepaintCount();
+ it->value.setBackBuffer(targetRect, sourceRect, backBuffer, offset);
}
PassRefPtr<BitmapTexture> CoordinatedBackingStore::texture() const
{
HashMap<int, CoordinatedBackingStoreTile>::const_iterator end = m_tiles.end();
for (HashMap<int, CoordinatedBackingStoreTile>::const_iterator it = m_tiles.begin(); it != end; ++it) {
- RefPtr<BitmapTexture> texture = it->second.texture();
+ RefPtr<BitmapTexture> texture = it->value.texture();
if (texture)
return texture;
}
@@ -112,7 +112,7 @@ void CoordinatedBackingStore::paintToTextureMapper(TextureMapper* textureMapper,
HashMap<int, CoordinatedBackingStoreTile>::iterator end = m_tiles.end();
FloatRect coveredRect;
for (HashMap<int, CoordinatedBackingStoreTile>::iterator it = m_tiles.begin(); it != end; ++it) {
- CoordinatedBackingStoreTile& tile = it->second;
+ CoordinatedBackingStoreTile& tile = it->value;
if (!tile.texture())
continue;
@@ -156,7 +156,7 @@ void CoordinatedBackingStore::commitTileOperations(TextureMapper* textureMapper)
HashMap<int, CoordinatedBackingStoreTile>::iterator tilesEnd = m_tiles.end();
for (HashMap<int, CoordinatedBackingStoreTile>::iterator it = m_tiles.begin(); it != tilesEnd; ++it)
- it->second.swapBuffers(textureMapper);
+ it->value.swapBuffers(textureMapper);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
index e6f582f22..1953afb61 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp
@@ -66,14 +66,14 @@ void LayerTreeCoordinatorProxy::updateTileForLayer(int layerID, int tileID, cons
{
RefPtr<ShareableSurface> surface;
#if USE(GRAPHICS_SURFACE)
- uint64_t token = updateInfo.surfaceHandle.graphicsSurfaceToken();
- if (token) {
- HashMap<uint64_t, RefPtr<ShareableSurface> >::iterator it = m_surfaces.find(token);
+ GraphicsSurfaceToken token = updateInfo.surfaceHandle.graphicsSurfaceToken();
+ if (token.isValid()) {
+ HashMap<GraphicsSurfaceToken::BufferHandle, RefPtr<ShareableSurface> >::iterator it = m_surfaces.find(token.frontBufferHandle);
if (it == m_surfaces.end()) {
surface = ShareableSurface::create(updateInfo.surfaceHandle);
- m_surfaces.add(token, surface);
+ m_surfaces.add(token.frontBufferHandle, surface);
} else
- surface = it->second;
+ surface = it->value;
} else
surface = ShareableSurface::create(updateInfo.surfaceHandle);
#else
@@ -116,10 +116,16 @@ void LayerTreeCoordinatorProxy::setCompositingLayerFilters(WebLayerID id, const
}
#endif
-void LayerTreeCoordinatorProxy::didRenderFrame()
+void LayerTreeCoordinatorProxy::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
{
dispatchUpdate(bind(&LayerTreeRenderer::flushLayerChanges, m_renderer.get()));
updateViewport();
+#if PLATFORM(QT)
+ m_drawingAreaProxy->page()->didRenderFrame(contentsSize, coveredRect);
+#else
+ UNUSED_PARAM(contentsSize);
+ UNUSED_PARAM(coveredRect);
+#endif
}
void LayerTreeCoordinatorProxy::createDirectlyCompositedImage(int64_t key, const WebKit::ShareableBitmap::Handle& handle)
@@ -174,10 +180,12 @@ void LayerTreeCoordinatorProxy::didChangeScrollPosition(const IntPoint& position
dispatchUpdate(bind(&LayerTreeRenderer::didChangeScrollPosition, m_renderer.get(), position));
}
-void LayerTreeCoordinatorProxy::syncCanvas(uint32_t id, const IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
+#if USE(GRAPHICS_SURFACE)
+void LayerTreeCoordinatorProxy::syncCanvas(uint32_t id, const IntSize& canvasSize, const GraphicsSurfaceToken& token, uint32_t frontBuffer)
{
- dispatchUpdate(bind(&LayerTreeRenderer::syncCanvas, m_renderer.get(), id, canvasSize, graphicsSurfaceToken, frontBuffer));
+ dispatchUpdate(bind(&LayerTreeRenderer::syncCanvas, m_renderer.get(), id, canvasSize, token, frontBuffer));
}
+#endif
void LayerTreeCoordinatorProxy::purgeBackingStores()
{
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
index 65a9f5e99..b1ef401a4 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
@@ -29,6 +29,7 @@
#include "WebLayerTreeInfo.h"
#include <WebCore/GraphicsContext.h>
#include <WebCore/GraphicsLayer.h>
+#include <WebCore/GraphicsSurfaceToken.h>
#include <WebCore/IntRect.h>
#include <WebCore/IntSize.h>
#include <WebCore/RunLoop.h>
@@ -63,7 +64,7 @@ public:
void purgeGLResources();
void setContentsSize(const WebCore::FloatSize&);
void setVisibleContentsRect(const WebCore::FloatRect&, float scale, const WebCore::FloatPoint& trajectoryVector);
- void didRenderFrame();
+ void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
void createTileForLayer(int layerID, int tileID, const WebCore::IntRect&, const SurfaceUpdateInfo&);
void updateTileForLayer(int layerID, int tileID, const WebCore::IntRect&, const SurfaceUpdateInfo&);
void removeTileForLayer(int layerID, int tileID);
@@ -73,7 +74,9 @@ public:
void updateViewport();
void renderNextFrame();
void didChangeScrollPosition(const WebCore::IntPoint& position);
- void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer);
+#if USE(GRAPHICS_SURFACE)
+ void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, const WebCore::GraphicsSurfaceToken&, uint32_t frontBuffer);
+#endif
void purgeBackingStores();
LayerTreeRenderer* layerTreeRenderer() const { return m_renderer.get(); }
void setLayerAnimatedOpacity(uint32_t, float);
@@ -88,7 +91,7 @@ protected:
float m_lastSentScale;
WebCore::FloatPoint m_lastSentTrajectoryVector;
#if USE(GRAPHICS_SURFACE)
- HashMap<uint64_t, RefPtr<ShareableSurface> > m_surfaces;
+ HashMap<WebCore::GraphicsSurfaceToken::BufferHandle, RefPtr<ShareableSurface> > m_surfaces;
#endif
};
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in
index 23869233c..b73960021 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in
@@ -31,9 +31,11 @@ messages -> LayerTreeCoordinatorProxy {
RemoveTileForLayer(uint32_t layerID, int tileID)
CreateDirectlyCompositedImage(int64_t key, WebKit::ShareableBitmap::Handle handle)
DestroyDirectlyCompositedImage(int64_t key)
- DidRenderFrame()
+ DidRenderFrame(WebCore::IntSize contentsSize, WebCore::IntRect coveredRect)
DidChangeScrollPosition(WebCore::IntPoint position)
- SyncCanvas(uint32_t id, WebCore::IntSize canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
+#if USE(GRAPHICS_SURFACE)
+ SyncCanvas(uint32_t id, WebCore::IntSize canvasSize, WebCore::GraphicsSurfaceToken token, uint32_t frontBuffer)
+#endif
SetLayerAnimatedOpacity(uint32_t id, float opacity)
SetLayerAnimatedTransform(uint32_t id, WebCore::TransformationMatrix transform)
}
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
index b94c66b9d..f053a57a6 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
@@ -126,7 +126,7 @@ void LayerTreeRenderer::paintToCurrentGLContext(const TransformationMatrix& matr
if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
currentRootLayer->setOpacity(opacity);
currentRootLayer->setTransform(matrix);
- currentRootLayer->syncCompositingStateForThisLayerOnly();
+ currentRootLayer->flushCompositingStateForThisLayerOnly();
}
layer->paint();
@@ -183,7 +183,7 @@ void LayerTreeRenderer::adjustPositionForFixedLayers()
LayerMap::iterator end = m_fixedLayers.end();
for (LayerMap::iterator it = m_fixedLayers.begin(); it != end; ++it)
- toTextureMapperLayer(it->second)->setScrollPositionDeltaIfNeeded(delta);
+ toTextureMapperLayer(it->value)->setScrollPositionDeltaIfNeeded(delta);
}
void LayerTreeRenderer::didChangeScrollPosition(const IntPoint& position)
@@ -191,12 +191,12 @@ void LayerTreeRenderer::didChangeScrollPosition(const IntPoint& position)
m_pendingRenderedContentsScrollPosition = position;
}
-void LayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
+#if USE(GRAPHICS_SURFACE)
+void LayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, const GraphicsSurfaceToken& token, uint32_t frontBuffer)
{
if (canvasSize.isEmpty() || !m_textureMapper)
return;
-#if USE(GRAPHICS_SURFACE)
ensureLayer(id);
GraphicsLayer* layer = layerByID(id);
@@ -206,18 +206,18 @@ void LayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvas
canvasBackingStore = TextureMapperSurfaceBackingStore::create();
m_surfaceBackingStores.set(id, canvasBackingStore);
} else
- canvasBackingStore = it->second;
+ canvasBackingStore = it->value;
- canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize, frontBuffer);
+ canvasBackingStore->setGraphicsSurface(token, canvasSize, frontBuffer);
layer->setContentsToMedia(canvasBackingStore.get());
-#endif
}
+#endif
void LayerTreeRenderer::setLayerChildren(WebLayerID id, const Vector<WebLayerID>& childIDs)
{
ensureLayer(id);
LayerMap::iterator it = m_layers.find(id);
- GraphicsLayer* layer = it->second;
+ GraphicsLayer* layer = it->value;
Vector<GraphicsLayer*> children;
for (size_t i = 0; i < childIDs.size(); ++i) {
@@ -239,7 +239,7 @@ void LayerTreeRenderer::setLayerFilters(WebLayerID id, const FilterOperations& f
LayerMap::iterator it = m_layers.find(id);
ASSERT(it != m_layers.end());
- GraphicsLayer* layer = it->second;
+ GraphicsLayer* layer = it->value;
layer->setFilters(filters);
}
#endif
@@ -250,7 +250,7 @@ void LayerTreeRenderer::setLayerState(WebLayerID id, const WebLayerInfo& layerIn
LayerMap::iterator it = m_layers.find(id);
ASSERT(it != m_layers.end());
- GraphicsLayer* layer = it->second;
+ GraphicsLayer* layer = it->value;
layer->setReplicatedByLayer(layerByID(layerInfo.replica));
layer->setMaskLayer(layerByID(layerInfo.mask));
@@ -377,7 +377,7 @@ void LayerTreeRenderer::assignImageToLayer(GraphicsLayer* layer, int64_t imageID
HashMap<int64_t, RefPtr<TextureMapperBackingStore> >::iterator it = m_directlyCompositedImages.find(imageID);
ASSERT(it != m_directlyCompositedImages.end());
- layer->setContentsToMedia(it->second.get());
+ layer->setContentsToMedia(it->value.get());
}
void LayerTreeRenderer::commitTileOperations()
@@ -393,7 +393,7 @@ void LayerTreeRenderer::flushLayerChanges()
{
m_renderedContentsScrollPosition = m_pendingRenderedContentsScrollPosition;
- m_rootLayer->syncCompositingState(FloatRect());
+ m_rootLayer->flushCompositingState(FloatRect());
commitTileOperations();
// The pending tiles state is on its way for the screen, tell the web process to render the next one.
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
index 4e45678e6..0a6ae3b88 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
@@ -22,13 +22,13 @@
#if USE(COORDINATED_GRAPHICS)
#include "BackingStore.h"
-#include "GraphicsSurface.h"
#include "ShareableSurface.h"
#include "TextureMapper.h"
#include "TextureMapperBackingStore.h"
#include "WebLayerTreeInfo.h"
#include <WebCore/GraphicsContext.h>
#include <WebCore/GraphicsLayer.h>
+#include <WebCore/GraphicsSurface.h>
#include <WebCore/IntRect.h>
#include <WebCore/IntSize.h>
#include <WebCore/RunLoop.h>
@@ -68,7 +68,9 @@ public:
void setContentsSize(const WebCore::FloatSize&);
void setVisibleContentsRect(const WebCore::FloatRect&);
void didChangeScrollPosition(const WebCore::IntPoint& position);
- void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer);
+#if USE(GRAPHICS_SURFACE)
+ void syncCanvas(uint32_t id, const WebCore::IntSize& canvasSize, const WebCore::GraphicsSurfaceToken&, uint32_t frontBuffer);
+#endif
void detach();
void appendUpdate(const Function<void()>&);
@@ -100,7 +102,7 @@ private:
// Reimplementations from WebCore::GraphicsLayerClient.
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double) { }
- virtual void notifySyncRequired(const WebCore::GraphicsLayer*) { }
+ virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) { }
virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const { return false; }
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const { return false; }
void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) { }