diff options
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 |