diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp | |
parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
download | qtwebkit-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/WebProcess/WebPage/qt/LayerTreeHostQt.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp index 9039454af..0114cf416 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp @@ -256,6 +256,12 @@ void LayerTreeHostQt::syncLayerChildren(WebLayerID id, const Vector<WebLayerID>& m_webPage->send(Messages::LayerTreeHostProxy::SetCompositingLayerChildren(id, children)); } +void LayerTreeHostQt::syncCanvas(WebLayerID id, const IntSize& canvasSize, uint32_t graphicsSurfaceToken) +{ + m_shouldSyncFrame = true; + m_webPage->send(Messages::LayerTreeHostProxy::SyncCanvas(id, canvasSize, graphicsSurfaceToken)); +} + #if ENABLE(CSS_FILTERS) void LayerTreeHostQt::syncLayerFilters(WebLayerID id, const FilterOperations& filters) { @@ -546,29 +552,29 @@ void LayerTreeHostQt::purgeBackingStores() m_updateAtlases.clear(); } -UpdateAtlas& LayerTreeHostQt::getAtlas(ShareableBitmap::Flags flags) +static PassOwnPtr<WebCore::GraphicsContext> beginContentUpdateInAtlas(UpdateAtlas& atlas, const WebCore::IntSize& size, ShareableSurface::Handle& handle, WebCore::IntPoint& offset) { - for (int i = 0; i < m_updateAtlases.size(); ++i) { - if (m_updateAtlases[i].flags() == flags) - return m_updateAtlases[i]; - } - static const int ScratchBufferDimension = 2000; - m_updateAtlases.append(UpdateAtlas(ScratchBufferDimension, flags)); - return m_updateAtlases.last(); + if (!atlas.surface()->createHandle(handle)) + return PassOwnPtr<WebCore::GraphicsContext>(); + return atlas.beginPaintingOnAvailableBuffer(size, offset); } PassOwnPtr<WebCore::GraphicsContext> LayerTreeHostQt::beginContentUpdate(const WebCore::IntSize& size, ShareableBitmap::Flags flags, ShareableSurface::Handle& handle, WebCore::IntPoint& offset) { - UpdateAtlas& atlas = getAtlas(flags); - if (!atlas.surface()->createHandle(handle)) - return PassOwnPtr<WebCore::GraphicsContext>(); - - // This will return null if there is no available buffer. - OwnPtr<WebCore::GraphicsContext> graphicsContext = atlas.beginPaintingOnAvailableBuffer(size, offset); - if (!graphicsContext) - return PassOwnPtr<WebCore::GraphicsContext>(); + OwnPtr<WebCore::GraphicsContext> graphicsContext; + for (int i = 0; i < m_updateAtlases.size(); ++i) { + UpdateAtlas& atlas = m_updateAtlases[i]; + if (atlas.flags() == flags) { + // This will return null if there is no available buffer space. + graphicsContext = beginContentUpdateInAtlas(atlas, size, handle, offset); + if (graphicsContext) + return graphicsContext.release(); + } + } - return graphicsContext.release(); + static const int ScratchBufferDimension = 2000; + m_updateAtlases.append(UpdateAtlas(ScratchBufferDimension, flags)); + return beginContentUpdateInAtlas(m_updateAtlases.last(), size, handle, offset); } } // namespace WebKit |