summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
commit49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch)
tree5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
parentb211c645d8ab690f713515dfdc84d80b11c27d2c (diff)
downloadqtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp b/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
index c6c0fadf8..c3e573923 100644
--- a/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
+++ b/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
@@ -30,6 +30,7 @@
#include "ShareableBitmap.h"
#include "TextureMapper.h"
#include "TextureMapperBackingStore.h"
+#include "TextureMapperGL.h"
#include "TextureMapperLayer.h"
#include "UpdateInfo.h"
#include <OpenGLShims.h>
@@ -85,7 +86,8 @@ static IntPoint boundedScrollPosition(const IntPoint& scrollPosition, const IntR
}
WebLayerTreeRenderer::WebLayerTreeRenderer(LayerTreeHostProxy* layerTreeHostProxy)
- : m_layerTreeHostProxy(layerTreeHostProxy)
+ : m_contentsScale(1)
+ , m_layerTreeHostProxy(layerTreeHostProxy)
, m_rootLayerID(InvalidWebLayerID)
, m_isActive(false)
{
@@ -194,6 +196,28 @@ void WebLayerTreeRenderer::didChangeScrollPosition(const IntPoint& position)
m_pendingRenderedContentsScrollPosition = boundedScrollPosition(position, m_visibleContentsRect, m_contentsSize);
}
+void WebLayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint32_t graphicsSurfaceToken)
+{
+ if (canvasSize.isEmpty() || !m_textureMapper)
+ return;
+
+#if USE(GRAPHICS_SURFACE)
+ ensureLayer(id);
+ GraphicsLayer* layer = layerByID(id);
+
+ RefPtr<TextureMapperSurfaceBackingStore> canvasBackingStore;
+ SurfaceBackingStoreMap::iterator it = m_surfaceBackingStores.find(id);
+ if (it == m_surfaceBackingStores.end()) {
+ canvasBackingStore = TextureMapperSurfaceBackingStore::create();
+ m_surfaceBackingStores.set(id, canvasBackingStore);
+ } else
+ canvasBackingStore = it->second;
+
+ canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize);
+ layer->setContentsToMedia(canvasBackingStore.get());
+#endif
+}
+
void WebLayerTreeRenderer::setLayerChildren(WebLayerID id, const Vector<WebLayerID>& childIDs)
{
ensureLayer(id);
@@ -271,6 +295,9 @@ void WebLayerTreeRenderer::deleteLayer(WebLayerID layerID)
layer->removeFromParent();
m_layers.remove(layerID);
m_fixedLayers.remove(layerID);
+#if USE(GRAPHICS_SURFACE)
+ m_surfaceBackingStores.remove(layerID);
+#endif
delete layer;
}
@@ -419,6 +446,9 @@ void WebLayerTreeRenderer::purgeGLResources()
layer->clearBackingStoresRecursive();
m_directlyCompositedImages.clear();
+#if USE(GRAPHICS_SURFACE)
+ m_surfaceBackingStores.clear();
+#endif
m_rootLayer->removeAllChildren();
m_rootLayer.clear();
@@ -428,6 +458,8 @@ void WebLayerTreeRenderer::purgeGLResources()
m_textureMapper.clear();
m_backingStoresWithPendingBuffers.clear();
+ setActive(false);
+
callOnMainThread(bind(&WebLayerTreeRenderer::purgeBackingStores, this));
}