WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-104360-20130626210059.patch (text/plain), 64.48 KB, created by
Gwang Yoon Hwang
on 2013-06-26 05:03:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gwang Yoon Hwang
Created:
2013-06-26 05:03:00 PDT
Size:
64.48 KB
patch
obsolete
>Subversion Revision: 151949 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cc53527559272d24ba7fa2eee1361825ced32475..915ec5bb0a0206f413ff3486a3bf7f64068c4e92 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,72 @@ >+2013-03-13 Gwang Yoon Hwang <ryumiel@company100.net> >+ >+ Coordinated Graphics: Separate CoordinatedLayerTreeHost into CoordinatedLayerTreeHost and CompositingCoordinator >+ https://bugs.webkit.org/show_bug.cgi?id=104360 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The CoordinatedLayerTreeHost has too many responsibilities. It >+ implements LayerTreeHost, GraphicsLayerClient, >+ CoordinatedGraphicsLayerClient, CoordinatedImageBacking::Client, >+ UpdateAtlas::Client, GraphicsLayerFactory and >+ WebCustomFilterProgramProxyClient. >+ >+ This refactoring reduces the responsibilities of CoordinatedLayerTreeHost. >+ >+ This patch introduces a new class called CompositingCoordinator, which >+ takes the responsibility of managing compositing resources in >+ WebProcess. >+ >+ CoordinatedLayerTreeHost now takes a part for scheduling and IPC >+ specific parts. >+ >+ No new tests, covered by existing tests. >+ >+ * CMakeLists.txt: >+ * Target.pri: >+ * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: Added. >+ (WebCore::CompositingCoordinator::create): >+ (WebCore::CompositingCoordinator::~CompositingCoordinator): >+ (WebCore::CompositingCoordinator::CompositingCoordinator): >+ (WebCore::CompositingCoordinator::setRootCompositingLayer): >+ (WebCore::CompositingCoordinator::sizeDidChange): >+ (WebCore::CompositingCoordinator::flushPendingLayerChanges): >+ (WebCore::CompositingCoordinator::syncDisplayState): >+ (WebCore::CompositingCoordinator::nextAnimationServiceTime): >+ (WebCore::CompositingCoordinator::clearPendingStateChanges): >+ (WebCore::CompositingCoordinator::initializeRootCompositingLayerIfNeeded): >+ (WebCore::CompositingCoordinator::createRootLayer): >+ (WebCore::CompositingCoordinator::syncLayerState): >+ (WebCore::CompositingCoordinator::createImageBackingIfNeeded): >+ (WebCore::CompositingCoordinator::createImageBacking): >+ (WebCore::CompositingCoordinator::updateImageBacking): >+ (WebCore::CompositingCoordinator::clearImageBackingContents): >+ (WebCore::CompositingCoordinator::removeImageBacking): >+ (WebCore::CompositingCoordinator::flushPendingImageBackingChanges): >+ (WebCore::CompositingCoordinator::notifyAnimationStarted): >+ (WebCore::CompositingCoordinator::notifyFlushRequired): >+ (WebCore::CompositingCoordinator::paintContents): >+ (WebCore::CompositingCoordinator::createGraphicsLayer): >+ (WebCore::CompositingCoordinator::deviceScaleFactor): >+ (WebCore::CompositingCoordinator::pageScaleFactor): >+ (WebCore::CompositingCoordinator::createUpdateAtlas): >+ (WebCore::CompositingCoordinator::removeUpdateAtlas): >+ (WebCore::CompositingCoordinator::visibleContentsRect): >+ (WebCore::CompositingCoordinator::mainContentsLayer): >+ (WebCore::CompositingCoordinator::setVisibleContentsRect): >+ (WebCore::CompositingCoordinator::deviceOrPageScaleFactorChanged): >+ (WebCore::CompositingCoordinator::detachLayer): >+ (WebCore::CompositingCoordinator::commitScrollOffset): >+ (WebCore::CompositingCoordinator::renderNextFrame): >+ (WebCore::CompositingCoordinator::purgeBackingStores): >+ (WebCore::CompositingCoordinator::paintToSurface): >+ (WebCore::CompositingCoordinator::scheduleReleaseInactiveAtlases): >+ (WebCore::CompositingCoordinator::releaseInactiveAtlasesTimerFired): >+ * platform/graphics/texmap/coordinated/CompositingCoordinator.h: Added. >+ (WebCore::CompositingCoordinator::clearRootLayer): >+ (WebCore::CompositingCoordinator::rootLayer): >+ (WebCore::CompositingCoordinator::state): >+ > 2013-06-24 Kangil Han <kangil.han@samsung.com> > > Adopt is/toHTMLFormElement for code cleanup >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 9d81f4f5ac0afb5062b35cf1c62bb9d6a315de91..a861914da5c28c75596027b8521ab8a77bf00ece 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,53 @@ >+2013-03-13 Gwang Yoon Hwang <ryumiel@company100.net> >+ >+ Coordinated Graphics: Separate CoordinatedLayerTreeHost into CoordinatedLayerTreeHost and CompositingCoordinator >+ https://bugs.webkit.org/show_bug.cgi?id=104360 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The CoordinatedLayerTreeHost has too many responsibilities. It >+ implements LayerTreeHost, GraphicsLayerClient, >+ CoordinatedGraphicsLayerClient, CoordinatedImageBacking::Client, >+ UpdateAtlas::Client, GraphicsLayerFactory and >+ WebCustomFilterProgramProxyClient. >+ >+ This refactoring reduces the responsibilities of CoordinatedLayerTreeHost. >+ >+ This patch introduces a new class called CompositingCoordinator, which >+ takes the responsibility of managing compositing resources in >+ WebProcess. >+ >+ CoordinatedLayerTreeHost now takes a part for scheduling and IPC >+ specific parts. >+ >+ No new tests, covered by existing tests. >+ >+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: >+ (WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost): >+ (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): >+ (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer): >+ (WebKit::CoordinatedLayerTreeHost::invalidate): >+ (WebKit::CoordinatedLayerTreeHost::forceRepaint): >+ (WebKit::CoordinatedLayerTreeHost::sizeDidChange): >+ (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect): >+ (WebKit::CoordinatedLayerTreeHost::renderNextFrame): >+ (WebKit::CoordinatedLayerTreeHost::purgeBackingStores): >+ (WebKit::CoordinatedLayerTreeHost::willSyncLayerState): >+ (WebKit::CoordinatedLayerTreeHost::prepareCustomFilterProxiesForAnimations): >+ (WebKit::CoordinatedLayerTreeHost::checkCustomFilterProgramProxies): >+ (WebKit::CoordinatedLayerTreeHost::removeCustomFilterProgramProxy): >+ (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): >+ (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush): >+ (WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer): >+ (WebKit::CoordinatedLayerTreeHost::paintLayerContents): >+ (WebKit::CoordinatedLayerTreeHost::commitSceneState): >+ (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): >+ (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): >+ (WebKit::CoordinatedLayerTreeHost::scheduleAnimation): >+ (WebKit::CoordinatedLayerTreeHost::commitScrollOffset): >+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: >+ * WebProcess/WebPage/LayerTreeHost.h: >+ > 2013-06-24 Kangil Han <kangil.han@samsung.com> > > Adopt is/toHTMLFormElement for code cleanup >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index c1ace5e30c5e1f1aee5c1f2ace78e567932dc96b..65738f4aa268a1f56d04e82f51612d8fb03ec955 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -1976,6 +1976,7 @@ set(WebCore_SOURCES > platform/graphics/filters/SpotLightSource.cpp > > platform/graphics/texmap/coordinated/AreaAllocator.cpp >+ platform/graphics/texmap/coordinated/CompositingCoordinator.cpp > platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp > platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp > platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp >diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri >index ee9eddf46e7b00b56b51e8dbea4593bb1c3088bd..f89a4e8b28d280980e61193f344ecfe5bf298aec 100644 >--- a/Source/WebCore/Target.pri >+++ b/Source/WebCore/Target.pri >@@ -4089,6 +4089,7 @@ use?(3D_GRAPHICS) { > platform/graphics/texmap/TextureMapperGL.h \ > platform/graphics/texmap/TextureMapperShaderProgram.h \ > platform/graphics/texmap/coordinated/AreaAllocator.h \ >+ platform/graphics/texmap/coordinated/CompositingCoordinator.h \ > platform/graphics/texmap/coordinated/CoordinatedBackingStore.h \ > platform/graphics/texmap/coordinated/CoordinatedCustomFilterOperation.h \ > platform/graphics/texmap/coordinated/CoordinatedCustomFilterProgram.h \ >@@ -4124,6 +4125,7 @@ use?(3D_GRAPHICS) { > platform/graphics/texmap/TextureMapperGL.cpp \ > platform/graphics/texmap/TextureMapperShaderProgram.cpp \ > platform/graphics/texmap/coordinated/AreaAllocator.cpp \ >+ platform/graphics/texmap/coordinated/CompositingCoordinator.cpp \ > platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp \ > platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp \ > platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp \ >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..65aaf1e3bee6800b304c4cfe0bec3fc7e1ed87e3 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp >@@ -0,0 +1,436 @@ >+/* >+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). >+ * Copyright (C) 2013 Company 100, Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#if USE(COORDINATED_GRAPHICS) >+#include "CompositingCoordinator.h" >+ >+#include "Frame.h" >+#include "FrameView.h" >+#include "GraphicsContext.h" >+#include "InspectorController.h" >+#include "Page.h" >+#include "Settings.h" >+#include <wtf/CurrentTime.h> >+#include <wtf/TemporaryChange.h> >+ >+namespace WebCore { >+ >+PassOwnPtr<CompositingCoordinator> CompositingCoordinator::create(Page* page, CompositingCoordinator::Client* client) >+{ >+ return adoptPtr(new CompositingCoordinator(page, client)); >+} >+ >+CompositingCoordinator::~CompositingCoordinator() >+{ >+ purgeBackingStores(); >+ >+ LayerMap::iterator end = m_registeredLayers.end(); >+ for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) >+ it->value->setCoordinator(0); >+} >+ >+CompositingCoordinator::CompositingCoordinator(Page* page, CompositingCoordinator::Client* client) >+ : m_page(page) >+ , m_client(client) >+ , m_rootCompositingLayer(0) >+ , m_isPurging(false) >+ , m_isFlushingLayerChanges(false) >+ , m_shouldSyncFrame(false) >+ , m_didInitializeRootCompositingLayer(false) >+ , m_releaseInactiveAtlasesTimer(this, &CompositingCoordinator::releaseInactiveAtlasesTimerFired) >+#if ENABLE(REQUEST_ANIMATION_FRAME) >+ , m_lastAnimationServiceTime(0) >+#endif >+{ >+ m_page->settings()->setApplyDeviceScaleFactorInCompositor(true); >+ >+ // This is a temporary way to enable this only in the GL case, until TextureMapperImageBuffer is removed. >+ // See https://bugs.webkit.org/show_bug.cgi?id=114869 >+ CoordinatedGraphicsLayer::setShouldSupportContentsTiling(true); >+} >+ >+void CompositingCoordinator::setRootCompositingLayer(GraphicsLayer* layer) >+{ >+ if (m_rootCompositingLayer) >+ m_rootCompositingLayer->removeFromParent(); >+ >+ m_rootCompositingLayer = layer; >+ if (m_rootCompositingLayer) >+ m_rootLayer->addChildAtIndex(m_rootCompositingLayer, 0); >+} >+ >+void CompositingCoordinator::sizeDidChange(const IntSize& newSize) >+{ >+ m_rootLayer->setSize(newSize); >+ m_client->notifyFlushRequired(); >+} >+ >+bool CompositingCoordinator::flushPendingLayerChanges() >+{ >+ TemporaryChange<bool> protector(m_isFlushingLayerChanges, true); >+ >+ initializeRootCompositingLayerIfNeeded(); >+ >+ m_rootLayer->flushCompositingStateForThisLayerOnly(); >+ m_client->didFlushRootLayer(); >+ >+ bool didSync = m_page->mainFrame()->view()->flushCompositingStateIncludingSubframes(); >+ >+ toCoordinatedGraphicsLayer(m_rootLayer.get())->updateContentBuffersIncludingSubLayers(); >+ toCoordinatedGraphicsLayer(m_rootLayer.get())->syncPendingStateChangesIncludingSubLayers(); >+ >+ flushPendingImageBackingChanges(); >+ >+ if (m_shouldSyncFrame) { >+ didSync = true; >+ >+ if (m_rootCompositingLayer) { >+ m_state.contentsSize = roundedIntSize(m_rootCompositingLayer->size()); >+ if (CoordinatedGraphicsLayer* contentsLayer = mainContentsLayer()) >+ m_state.coveredRect = contentsLayer->coverRect(); >+ } >+ m_state.scrollPosition = m_visibleContentsRect.location(); >+ >+ m_client->commitSceneState(m_state); >+ >+ clearPendingStateChanges(); >+ m_shouldSyncFrame = false; >+ } >+ >+ return didSync; >+} >+ >+void CompositingCoordinator::syncDisplayState() >+{ >+#if ENABLE(INSPECTOR) >+ m_page->inspectorController()->didBeginFrame(); >+#endif >+ >+#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) && !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+ // Make sure that any previously registered animation callbacks are being executed before we flush the layers. >+ m_lastAnimationServiceTime = WTF::monotonicallyIncreasingTime(); >+ m_page->mainFrame()->view()->serviceScriptedAnimations(m_lastAnimationServiceTime); >+#endif >+ m_page->mainFrame()->view()->updateLayoutAndStyleIfNeededRecursive(); >+} >+ >+#if ENABLE(REQUEST_ANIMATION_FRAME) >+double CompositingCoordinator::nextAnimationServiceTime() const >+{ >+ // According to the requestAnimationFrame spec, rAF callbacks should not be faster than 60FPS. >+ static const double MinimalTimeoutForAnimations = 1. / 60.; >+ return std::max<double>(0., MinimalTimeoutForAnimations - WTF::monotonicallyIncreasingTime() + m_lastAnimationServiceTime); >+} >+#endif >+ >+void CompositingCoordinator::clearPendingStateChanges() >+{ >+ m_state.layersToCreate.clear(); >+ m_state.layersToUpdate.clear(); >+ m_state.layersToRemove.clear(); >+ >+ m_state.imagesToCreate.clear(); >+ m_state.imagesToRemove.clear(); >+ m_state.imagesToUpdate.clear(); >+ m_state.imagesToClear.clear(); >+ >+ m_state.updateAtlasesToCreate.clear(); >+ m_state.updateAtlasesToRemove.clear(); >+ >+#if ENABLE(CSS_SHADERS) >+ m_state.customFiltersToCreate.clear(); >+ m_state.customFiltersToRemove.clear(); >+#endif >+} >+ >+void CompositingCoordinator::initializeRootCompositingLayerIfNeeded() >+{ >+ if (m_didInitializeRootCompositingLayer) >+ return; >+ >+ m_state.rootCompositingLayer = toCoordinatedGraphicsLayer(m_rootLayer.get())->id(); >+ m_didInitializeRootCompositingLayer = true; >+ m_shouldSyncFrame = true; >+} >+ >+void CompositingCoordinator::createRootLayer(const IntSize& size) >+{ >+ ASSERT(!m_rootLayer); >+ // Create a root layer. >+ m_rootLayer = GraphicsLayer::create(this, this); >+#ifndef NDEBUG >+ m_rootLayer->setName("CompositingCoordinator root layer"); >+#endif >+ m_rootLayer->setDrawsContent(false); >+ m_rootLayer->setSize(size); >+} >+ >+void CompositingCoordinator::syncLayerState(CoordinatedLayerID id, CoordinatedGraphicsLayerState& state) >+{ >+ m_shouldSyncFrame = true; >+ >+ m_client->willSyncLayerState(state); >+ >+ m_state.layersToUpdate.append(std::make_pair(id, state)); >+} >+ >+PassRefPtr<CoordinatedImageBacking> CompositingCoordinator::createImageBackingIfNeeded(Image* image) >+{ >+ CoordinatedImageBackingID imageID = CoordinatedImageBacking::getCoordinatedImageBackingID(image); >+ ImageBackingMap::iterator it = m_imageBackings.find(imageID); >+ RefPtr<CoordinatedImageBacking> imageBacking; >+ if (it == m_imageBackings.end()) { >+ imageBacking = CoordinatedImageBacking::create(this, image); >+ m_imageBackings.add(imageID, imageBacking); >+ } else >+ imageBacking = it->value; >+ >+ return imageBacking; >+} >+ >+void CompositingCoordinator::createImageBacking(CoordinatedImageBackingID imageID) >+{ >+ m_state.imagesToCreate.append(imageID); >+} >+ >+void CompositingCoordinator::updateImageBacking(CoordinatedImageBackingID imageID, PassRefPtr<CoordinatedSurface> coordinatedSurface) >+{ >+ m_shouldSyncFrame = true; >+ m_state.imagesToUpdate.append(std::make_pair(imageID, coordinatedSurface)); >+} >+ >+void CompositingCoordinator::clearImageBackingContents(CoordinatedImageBackingID imageID) >+{ >+ m_shouldSyncFrame = true; >+ m_state.imagesToClear.append(imageID); >+} >+ >+void CompositingCoordinator::removeImageBacking(CoordinatedImageBackingID imageID) >+{ >+ if (m_isPurging) >+ return; >+ >+ ASSERT(m_imageBackings.contains(imageID)); >+ m_imageBackings.remove(imageID); >+ >+ m_state.imagesToRemove.append(imageID); >+} >+ >+void CompositingCoordinator::flushPendingImageBackingChanges() >+{ >+ ImageBackingMap::iterator end = m_imageBackings.end(); >+ for (ImageBackingMap::iterator iter = m_imageBackings.begin(); iter != end; ++iter) >+ iter->value->update(); >+} >+ >+void CompositingCoordinator::notifyAnimationStarted(const GraphicsLayer*, double /* time */) >+{ >+} >+ >+void CompositingCoordinator::notifyFlushRequired(const GraphicsLayer*) >+{ >+ m_client->notifyFlushRequired(); >+} >+ >+ >+void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect) >+{ >+ m_client->paintLayerContents(graphicsLayer, graphicsContext, clipRect); >+} >+ >+PassOwnPtr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayerClient* client) >+{ >+ CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client); >+ layer->setCoordinator(this); >+ m_registeredLayers.add(layer->id(), layer); >+ m_state.layersToCreate.append(layer->id()); >+ layer->setNeedsVisibleRectAdjustment(); >+ m_client->notifyFlushRequired(); >+ return adoptPtr(layer); >+} >+ >+float CompositingCoordinator::deviceScaleFactor() const >+{ >+ return m_page->deviceScaleFactor(); >+} >+ >+float CompositingCoordinator::pageScaleFactor() const >+{ >+ return m_page->pageScaleFactor(); >+} >+ >+void CompositingCoordinator::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> coordinatedSurface) >+{ >+ m_state.updateAtlasesToCreate.append(std::make_pair(atlasID, coordinatedSurface)); >+} >+ >+void CompositingCoordinator::removeUpdateAtlas(uint32_t atlasID) >+{ >+ if (m_isPurging) >+ return; >+ m_state.updateAtlasesToRemove.append(atlasID); >+} >+ >+FloatRect CompositingCoordinator::visibleContentsRect() const >+{ >+ return m_visibleContentsRect; >+} >+ >+CoordinatedGraphicsLayer* CompositingCoordinator::mainContentsLayer() >+{ >+ if (!m_rootCompositingLayer) >+ return 0; >+ >+ return toCoordinatedGraphicsLayer(m_rootCompositingLayer)->findFirstDescendantWithContentsRecursively(); >+} >+ >+void CompositingCoordinator::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector) >+{ >+ // A zero trajectoryVector indicates that tiles all around the viewport are requested. >+ if (CoordinatedGraphicsLayer* contentsLayer = mainContentsLayer()) >+ contentsLayer->setVisibleContentRectTrajectoryVector(trajectoryVector); >+ >+ bool contentsRectDidChange = rect != m_visibleContentsRect; >+ if (contentsRectDidChange) { >+ m_visibleContentsRect = rect; >+ >+ LayerMap::iterator end = m_registeredLayers.end(); >+ for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) >+ it->value->setNeedsVisibleRectAdjustment(); >+ } >+ >+ FrameView* view = m_page->mainFrame()->view(); >+ if (view->useFixedLayout()) { >+ // Round the rect instead of enclosing it to make sure that its size stays >+ // the same while panning. This can have nasty effects on layout. >+ view->setFixedVisibleContentRect(roundedIntRect(rect)); >+ } >+} >+ >+void CompositingCoordinator::deviceOrPageScaleFactorChanged() >+{ >+ m_rootLayer->deviceOrPageScaleFactorChanged(); >+} >+ >+void CompositingCoordinator::detachLayer(CoordinatedGraphicsLayer* layer) >+{ >+ if (m_isPurging) >+ return; >+ >+ m_registeredLayers.remove(layer->id()); >+ >+ size_t index = m_state.layersToCreate.find(layer->id()); >+ if (index != notFound) { >+ m_state.layersToCreate.remove(index); >+ return; >+ } >+ >+ m_state.layersToRemove.append(layer->id()); >+ m_client->notifyFlushRequired(); >+} >+ >+void CompositingCoordinator::commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset) >+{ >+ LayerMap::iterator i = m_registeredLayers.find(layerID); >+ if (i == m_registeredLayers.end()) >+ return; >+ >+ i->value->commitScrollOffset(offset); >+} >+ >+void CompositingCoordinator::renderNextFrame() >+{ >+ for (unsigned i = 0; i < m_updateAtlases.size(); ++i) >+ m_updateAtlases[i]->didSwapBuffers(); >+} >+ >+void CompositingCoordinator::purgeBackingStores() >+{ >+ TemporaryChange<bool> purgingToggle(m_isPurging, true); >+ >+ LayerMap::iterator end = m_registeredLayers.end(); >+ for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) >+ it->value->purgeBackingStores(); >+ >+ m_imageBackings.clear(); >+ m_updateAtlases.clear(); >+} >+ >+bool CompositingCoordinator::paintToSurface(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset, CoordinatedSurface::Client* client) >+{ >+ for (unsigned i = 0; i < m_updateAtlases.size(); ++i) { >+ UpdateAtlas* atlas = m_updateAtlases[i].get(); >+ if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) { >+ // This will be false if there is no available buffer space. >+ if (atlas->paintOnAvailableBuffer(size, atlasID, offset, client)) >+ return true; >+ } >+ } >+ >+ static const int ScratchBufferDimension = 1024; // Should be a power of two. >+ m_updateAtlases.append(adoptPtr(new UpdateAtlas(this, ScratchBufferDimension, flags))); >+ scheduleReleaseInactiveAtlases(); >+ return m_updateAtlases.last()->paintOnAvailableBuffer(size, atlasID, offset, client); >+} >+ >+const double ReleaseInactiveAtlasesTimerInterval = 0.5; >+ >+void CompositingCoordinator::scheduleReleaseInactiveAtlases() >+{ >+ if (!m_releaseInactiveAtlasesTimer.isActive()) >+ m_releaseInactiveAtlasesTimer.startRepeating(ReleaseInactiveAtlasesTimerInterval); >+} >+ >+void CompositingCoordinator::releaseInactiveAtlasesTimerFired(Timer<CompositingCoordinator>*) >+{ >+ // We always want to keep one atlas for non-composited content. >+ OwnPtr<UpdateAtlas> atlasToKeepAnyway; >+ bool foundActiveAtlasForNonCompositedContent = false; >+ for (int i = m_updateAtlases.size() - 1; i >= 0; --i) { >+ UpdateAtlas* atlas = m_updateAtlases[i].get(); >+ if (!atlas->isInUse()) >+ atlas->addTimeInactive(ReleaseInactiveAtlasesTimerInterval); >+ bool usableForNonCompositedContent = !atlas->supportsAlpha(); >+ if (atlas->isInactive()) { >+ if (!foundActiveAtlasForNonCompositedContent && !atlasToKeepAnyway && usableForNonCompositedContent) >+ atlasToKeepAnyway = m_updateAtlases[i].release(); >+ m_updateAtlases.remove(i); >+ } else if (usableForNonCompositedContent) >+ foundActiveAtlasForNonCompositedContent = true; >+ } >+ >+ if (!foundActiveAtlasForNonCompositedContent && atlasToKeepAnyway) >+ m_updateAtlases.append(atlasToKeepAnyway.release()); >+ >+ if (m_updateAtlases.size() <= 1) >+ m_releaseInactiveAtlasesTimer.stop(); >+} >+ >+} // namespace WebCore >+ >+#endif // USE(COORDINATED_GRAPHICS) >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h b/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h >new file mode 100644 >index 0000000000000000000000000000000000000000..f80fd83afa19bf89d0440be29cfeec5d425c298f >--- /dev/null >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h >@@ -0,0 +1,168 @@ >+/* >+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) >+ * Copyright (C) 2013 Company 100, Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef CompositingCoordinator_h >+#define CompositingCoordinator_h >+ >+#if USE(COORDINATED_GRAPHICS) >+ >+#include "CoordinatedGraphicsLayer.h" >+#include "CoordinatedGraphicsState.h" >+#include "CoordinatedImageBacking.h" >+#include "FloatPoint.h" >+#include "GraphicsLayerClient.h" >+#include "GraphicsLayerFactory.h" >+#include "IntRect.h" >+#include "Timer.h" >+#include "UpdateAtlas.h" >+#include <wtf/OwnPtr.h> >+ >+#if ENABLE(CSS_SHADERS) >+#include "FilterOperations.h" >+#endif >+ >+namespace WebCore { >+ >+class Page; >+class GraphicsContext; >+class GraphicsLayer; >+class CoordinatedSurface; >+ >+class CompositingCoordinator : public GraphicsLayerClient >+ , public CoordinatedGraphicsLayerClient >+ , public CoordinatedImageBacking::Client >+ , public UpdateAtlas::Client >+ , public GraphicsLayerFactory { >+ WTF_MAKE_NONCOPYABLE(CompositingCoordinator); WTF_MAKE_FAST_ALLOCATED; >+public: >+ class Client { >+ public: >+ virtual void didFlushRootLayer() = 0; >+ virtual void willSyncLayerState(CoordinatedGraphicsLayerState&) = 0; >+ virtual void notifyFlushRequired() = 0; >+ virtual void commitSceneState(CoordinatedGraphicsState&) = 0; >+ virtual void paintLayerContents(const GraphicsLayer*, GraphicsContext&, const IntRect& clipRect) = 0; >+ }; >+ >+ static PassOwnPtr<CompositingCoordinator> create(Page*, CompositingCoordinator::Client*); >+ virtual ~CompositingCoordinator(); >+ >+ void setRootCompositingLayer(GraphicsLayer*); >+ void sizeDidChange(const IntSize& newSize); >+ void deviceOrPageScaleFactorChanged(); >+ >+ void setVisibleContentsRect(const FloatRect&, const FloatPoint&); >+ void renderNextFrame(); >+ void purgeBackingStores(); >+ void commitScrollOffset(uint32_t layerID, const IntSize& offset); >+ >+ void createRootLayer(const IntSize&); >+ void clearRootLayer() { m_rootLayer = nullptr; } >+ GraphicsLayer* rootLayer() const { return m_rootLayer.get(); } >+ CoordinatedGraphicsLayer* mainContentsLayer(); >+ >+ bool flushPendingLayerChanges(); >+ CoordinatedGraphicsState& state() { return m_state; } >+ >+ void syncDisplayState(); >+ >+#if ENABLE(REQUEST_ANIMATION_FRAME) >+ double nextAnimationServiceTime() const; >+#endif >+ >+private: >+ CompositingCoordinator(Page*, CompositingCoordinator::Client*); >+ >+ // GraphicsLayerClient >+ virtual void notifyAnimationStarted(const GraphicsLayer*, double time) OVERRIDE; >+ virtual void notifyFlushRequired(const GraphicsLayer*) OVERRIDE; >+ virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clipRect) OVERRIDE; >+ virtual float deviceScaleFactor() const OVERRIDE; >+ virtual float pageScaleFactor() const OVERRIDE; >+ >+ // CoordinatedImageBacking::Client >+ virtual void createImageBacking(CoordinatedImageBackingID) OVERRIDE; >+ virtual void updateImageBacking(CoordinatedImageBackingID, PassRefPtr<CoordinatedSurface>) OVERRIDE; >+ virtual void clearImageBackingContents(CoordinatedImageBackingID) OVERRIDE; >+ virtual void removeImageBacking(CoordinatedImageBackingID) OVERRIDE; >+ >+ // CoordinatedGraphicsLayerClient >+ virtual bool isFlushingLayerChanges() const OVERRIDE { return m_isFlushingLayerChanges; } >+ virtual FloatRect visibleContentsRect() const OVERRIDE; >+ virtual PassRefPtr<CoordinatedImageBacking> createImageBackingIfNeeded(Image*) OVERRIDE; >+ virtual void detachLayer(CoordinatedGraphicsLayer*) OVERRIDE; >+ virtual bool paintToSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& /* atlasID */, WebCore::IntPoint&, WebCore::CoordinatedSurface::Client*) OVERRIDE; >+ virtual void syncLayerState(CoordinatedLayerID, CoordinatedGraphicsLayerState&) OVERRIDE; >+ >+ // UpdateAtlas::Client >+ virtual void createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface>) OVERRIDE; >+ virtual void removeUpdateAtlas(uint32_t atlasID) OVERRIDE; >+ >+ // GraphicsLayerFactory >+ virtual PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient*) OVERRIDE; >+ >+ void initializeRootCompositingLayerIfNeeded(); >+ void flushPendingImageBackingChanges(); >+ void clearPendingStateChanges(); >+ >+ void scheduleReleaseInactiveAtlases(); >+ >+ void releaseInactiveAtlasesTimerFired(Timer<CompositingCoordinator>*); >+ >+ Page* m_page; >+ CompositingCoordinator::Client* m_client; >+ >+ OwnPtr<GraphicsLayer> m_rootLayer; >+ GraphicsLayer* m_rootCompositingLayer; >+ >+ CoordinatedGraphicsState m_state; >+ >+ typedef HashMap<CoordinatedLayerID, CoordinatedGraphicsLayer*> LayerMap; >+ LayerMap m_registeredLayers; >+ typedef HashMap<CoordinatedImageBackingID, RefPtr<CoordinatedImageBacking> > ImageBackingMap; >+ ImageBackingMap m_imageBackings; >+ Vector<OwnPtr<UpdateAtlas> > m_updateAtlases; >+ >+ // We don't send the messages related to releasing resources to renderer during purging, because renderer already had removed all resources. >+ bool m_isPurging; >+ bool m_isFlushingLayerChanges; >+ >+ FloatRect m_visibleContentsRect; >+ >+ bool m_shouldSyncFrame; >+ bool m_didInitializeRootCompositingLayer; >+ Timer<CompositingCoordinator> m_releaseInactiveAtlasesTimer; >+ >+#if ENABLE(REQUEST_ANIMATION_FRAME) >+ double m_lastAnimationServiceTime; >+#endif >+}; >+ >+} >+ >+#endif >+ >+#endif // CompositingCoordinator_h >diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp >index 186b2eb664e18df9a895c05c9044f86506556fe3..590b74c0789d5d56930c0c93ae1db2704440c6a4 100644 >--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp >+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp >@@ -40,18 +40,8 @@ > #include "WebPageProxyMessages.h" > #include <WebCore/Frame.h> > #include <WebCore/FrameView.h> >-#include <WebCore/GraphicsSurface.h> >-#include <WebCore/InspectorController.h> >-#include <WebCore/Page.h> >-#include <WebCore/RenderLayer.h> >-#include <WebCore/RenderLayerBacking.h> >-#include <WebCore/RenderLayerCompositor.h> >-#include <WebCore/RenderView.h> > #include <WebCore/Settings.h> >-#include <WebCore/SurfaceUpdateInfo.h> >-#include <WebCore/TextureMapperPlatformLayer.h> > #include <wtf/CurrentTime.h> >-#include <wtf/TemporaryChange.h> > > #if ENABLE(CSS_SHADERS) > #include "CustomFilterValidatedProgram.h" >@@ -72,51 +62,26 @@ CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost() > #if ENABLE(CSS_SHADERS) > disconnectCustomFilterPrograms(); > #endif >- purgeBackingStores(); >- >- LayerMap::iterator end = m_registeredLayers.end(); >- for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) >- it->value->setCoordinator(0); > } > > CoordinatedLayerTreeHost::CoordinatedLayerTreeHost(WebPage* webPage) > : LayerTreeHost(webPage) >- , m_rootCompositingLayer(0) > , m_notifyAfterScheduledLayerFlush(false) > , m_isValid(true) >- , m_isPurging(false) >- , m_isFlushingLayerChanges(false) >- , m_waitingForUIProcess(true) > , m_isSuspended(false) >- , m_shouldSyncFrame(false) >- , m_didInitializeRootCompositingLayer(false) >+ , m_isWaitingForRenderer(true) > , m_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired) >- , m_releaseInactiveAtlasesTimer(this, &CoordinatedLayerTreeHost::releaseInactiveAtlasesTimerFired) > , m_layerFlushSchedulingEnabled(true) > , m_forceRepaintAsyncCallbackID(0) >- , m_animationsLocked(false) >-#if ENABLE(REQUEST_ANIMATION_FRAME) >- , m_lastAnimationServiceTime(0) >-#endif > { >- m_webPage->corePage()->settings()->setApplyDeviceScaleFactorInCompositor(true); >+ m_coordinator = CompositingCoordinator::create(webPage->corePage(), this); > >- // Create a root layer. >- m_rootLayer = GraphicsLayer::create(this, this); >-#ifndef NDEBUG >- m_rootLayer->setName("CoordinatedLayerTreeHost root layer"); >-#endif >- m_rootLayer->setDrawsContent(false); >- m_rootLayer->setSize(m_webPage->size()); >- m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(m_rootLayer.get())->id(); >+ m_coordinator->createRootLayer(webPage->size()); >+ m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(m_coordinator->rootLayer())->id(); > > CoordinatedSurface::setFactory(createCoordinatedSurface); > >- // This is a temporary way to enable this only in the GL case, until TextureMapperImageBuffer is removed. >- // See https://bugs.webkit.org/show_bug.cgi?id=114869 >- CoordinatedGraphicsLayer::setShouldSupportContentsTiling(true); >- >- if (m_webPage->hasPageOverlay()) >+ if (webPage->hasPageOverlay()) > createPageOverlayLayer(); > > scheduleLayerFlush(); >@@ -158,12 +123,7 @@ void CoordinatedLayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool > > void CoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer) > { >- if (m_rootCompositingLayer) >- m_rootCompositingLayer->removeFromParent(); >- >- m_rootCompositingLayer = graphicsLayer; >- if (m_rootCompositingLayer) >- m_rootLayer->addChildAtIndex(m_rootCompositingLayer, 0); >+ m_coordinator->setRootCompositingLayer(graphicsLayer); > } > > void CoordinatedLayerTreeHost::invalidate() >@@ -171,7 +131,7 @@ void CoordinatedLayerTreeHost::invalidate() > cancelPendingLayerFlush(); > > ASSERT(m_isValid); >- m_rootLayer = nullptr; >+ m_coordinator->clearRootLayer(); > m_isValid = false; > } > >@@ -179,12 +139,12 @@ void CoordinatedLayerTreeHost::forceRepaint() > { > // This is necessary for running layout tests. Since in this case we are not waiting for a UIProcess to reply nicely. > // Instead we are just triggering forceRepaint. But we still want to have the scripted animation callbacks being executed. >- syncDisplayState(); >+ m_coordinator->syncDisplayState(); > > // We need to schedule another flush, otherwise the forced paint might cancel a later expected flush. > // This is aligned with LayerTreeHostCA. > scheduleLayerFlush(); >- flushPendingLayerChanges(); >+ m_coordinator->flushPendingLayerChanges(); > } > > bool CoordinatedLayerTreeHost::forceRepaintAsync(uint64_t callbackID) >@@ -198,7 +158,7 @@ bool CoordinatedLayerTreeHost::forceRepaintAsync(uint64_t callbackID) > > void CoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize& newSize) > { >- m_rootLayer->setSize(newSize); >+ m_coordinator->sizeDidChange(newSize); > scheduleLayerFlush(); > } > >@@ -233,111 +193,49 @@ void CoordinatedLayerTreeHost::setPageOverlayOpacity(PageOverlay*, float value) > scheduleLayerFlush(); > } > >-bool CoordinatedLayerTreeHost::flushPendingLayerChanges() >+void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector) > { >- if (m_waitingForUIProcess) >- return false; >- >- TemporaryChange<bool> protector(m_isFlushingLayerChanges, true); >- >- initializeRootCompositingLayerIfNeeded(); >- >- m_rootLayer->flushCompositingStateForThisLayerOnly(); >- if (m_pageOverlayLayer) >- m_pageOverlayLayer->flushCompositingStateForThisLayerOnly(); >- >- bool didSync = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes(); >- >- toCoordinatedGraphicsLayer(m_rootLayer.get())->updateContentBuffersIncludingSubLayers(); >- toCoordinatedGraphicsLayer(m_rootLayer.get())->syncPendingStateChangesIncludingSubLayers(); >- >- flushPendingImageBackingChanges(); >- >- if (m_shouldSyncFrame) { >- didSync = true; >- >- if (m_rootCompositingLayer) { >- m_state.contentsSize = roundedIntSize(m_rootCompositingLayer->size()); >- if (CoordinatedGraphicsLayer* contentsLayer = mainContentsLayer()) >- m_state.coveredRect = contentsLayer->coverRect(); >- } >- >- m_state.scrollPosition = m_visibleContentsRect.location(); >- >- m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(m_state)); >- >- clearPendingStateChanges(); >- m_waitingForUIProcess = true; >- m_shouldSyncFrame = false; >- } >- >- if (m_forceRepaintAsyncCallbackID) { >- m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID)); >- m_forceRepaintAsyncCallbackID = 0; >- } >- >- return didSync; >+ m_coordinator->setVisibleContentsRect(rect, trajectoryVector); >+ scheduleLayerFlush(); > } > >-void CoordinatedLayerTreeHost::clearPendingStateChanges() >+void CoordinatedLayerTreeHost::renderNextFrame() > { >- m_state.layersToCreate.clear(); >- m_state.layersToUpdate.clear(); >- m_state.layersToRemove.clear(); >- >- m_state.imagesToCreate.clear(); >- m_state.imagesToRemove.clear(); >- m_state.imagesToUpdate.clear(); >- m_state.imagesToClear.clear(); >- >- m_state.updateAtlasesToCreate.clear(); >- m_state.updateAtlasesToRemove.clear(); >- >-#if ENABLE(CSS_SHADERS) >- m_state.customFiltersToCreate.clear(); >- m_state.customFiltersToRemove.clear(); >-#endif >+ m_coordinator->renderNextFrame(); >+ m_isWaitingForRenderer = false; >+ scheduleLayerFlush(); > } > >-void CoordinatedLayerTreeHost::initializeRootCompositingLayerIfNeeded() >+void CoordinatedLayerTreeHost::purgeBackingStores() > { >- if (m_didInitializeRootCompositingLayer) >- return; >- >- m_state.rootCompositingLayer = toCoordinatedGraphicsLayer(m_rootLayer.get())->id(); >- m_didInitializeRootCompositingLayer = true; >- m_shouldSyncFrame = true; >+ m_coordinator->purgeBackingStores(); > } > >-void CoordinatedLayerTreeHost::syncLayerState(CoordinatedLayerID id, CoordinatedGraphicsLayerState& state) >+void CoordinatedLayerTreeHost::willSyncLayerState(CoordinatedGraphicsLayerState& state) > { >- m_shouldSyncFrame = true; >- > #if ENABLE(CSS_SHADERS) >- prepareCustomFilterProxiesIfNeeded(state); >-#endif >+ if (state.animationsChanged) >+ prepareCustomFilterProxiesForAnimations(state.animations); > >- m_state.layersToUpdate.append(std::make_pair(id, state)); >+ if (state.filtersChanged) >+ checkCustomFilterProgramProxies(state.filters); >+#else >+ UNUSED_PARAM(state); >+#endif > } > > #if ENABLE(CSS_SHADERS) >-void CoordinatedLayerTreeHost::prepareCustomFilterProxiesIfNeeded(CoordinatedGraphicsLayerState& state) >-{ >- if (state.animationsChanged) { >- GraphicsLayerAnimations& activeAnimations = state.animations; >- for (size_t i = 0; i < activeAnimations.animations().size(); ++i) { >- const KeyframeValueList& keyframes = activeAnimations.animations().at(i).keyframes(); >- if (keyframes.property() != AnimatedPropertyWebkitFilter) >- continue; >- for (size_t j = 0; j < keyframes.size(); ++j) { >- const FilterAnimationValue& filterValue = static_cast<const FilterAnimationValue&>(keyframes.at(j)); >- checkCustomFilterProgramProxies(filterValue.value()); >- } >+void CoordinatedLayerTreeHost::prepareCustomFilterProxiesForAnimations(GraphicsLayerAnimations& activeAnimations) >+{ >+ for (size_t i = 0; i < activeAnimations.animations().size(); ++i) { >+ const KeyframeValueList& keyframes = activeAnimations.animations().at(i).keyframes(); >+ if (keyframes.property() != AnimatedPropertyWebkitFilter) >+ continue; >+ for (size_t j = 0; j < keyframes.size(); ++j) { >+ const FilterAnimationValue& filterValue = static_cast<const FilterAnimationValue&>(keyframes.at(j)); >+ checkCustomFilterProgramProxies(filterValue.value()); > } > } >- >- if (state.filtersChanged) >- checkCustomFilterProgramProxies(state.filters); > } > > void CoordinatedLayerTreeHost::checkCustomFilterProgramProxies(const FilterOperations& filters) >@@ -367,7 +265,7 @@ void CoordinatedLayerTreeHost::checkCustomFilterProgramProxies(const FilterOpera > if (!customFilterProgramProxy->client()) { > customFilterProgramProxy->setClient(this); > m_customFilterPrograms.add(customFilterProgramProxy.get()); >- m_state.customFiltersToCreate.append(std::make_pair(customFilterProgramProxy->id(), customOperation->validatedProgram()->validatedProgramInfo())); >+ m_coordinator->state().customFiltersToCreate.append(std::make_pair(customFilterProgramProxy->id(), customOperation->validatedProgram()->validatedProgramInfo())); > } else { > // If the client was not disconnected then this coordinator must be the client for it. > ASSERT(customFilterProgramProxy->client() == this); >@@ -380,7 +278,7 @@ void CoordinatedLayerTreeHost::removeCustomFilterProgramProxy(WebCustomFilterPro > // At this time the shader is not needed anymore, so we remove it from our set and > // send a message to the other process to delete it. > m_customFilterPrograms.remove(customFilterProgramProxy); >- m_state.customFiltersToRemove.append(customFilterProgramProxy->id()); >+ m_coordinator->state().customFiltersToRemove.append(customFilterProgramProxy->id()); > } > > void CoordinatedLayerTreeHost::disconnectCustomFilterPrograms() >@@ -392,52 +290,30 @@ void CoordinatedLayerTreeHost::disconnectCustomFilterPrograms() > } > #endif // ENABLE(CSS_SHADERS) > >-void CoordinatedLayerTreeHost::detachLayer(CoordinatedGraphicsLayer* layer) >+void CoordinatedLayerTreeHost::didFlushRootLayer() > { >- m_registeredLayers.remove(layer->id()); >- >- size_t index = m_state.layersToCreate.find(layer->id()); >- if (index != notFound) { >- m_state.layersToCreate.remove(index); >- return; >- } >- >- m_state.layersToRemove.append(layer->id()); >- scheduleLayerFlush(); >+ if (m_pageOverlayLayer) >+ m_pageOverlayLayer->flushCompositingStateForThisLayerOnly(); > } > > void CoordinatedLayerTreeHost::performScheduledLayerFlush() > { >- if (m_isSuspended || m_waitingForUIProcess) >+ if (m_isSuspended || m_isWaitingForRenderer) > return; > >- syncDisplayState(); >+ m_coordinator->syncDisplayState(); > > if (!m_isValid) > return; > >- if (flushPendingLayerChanges()) >- didPerformScheduledLayerFlush(); >-} >- >-void CoordinatedLayerTreeHost::syncDisplayState() >-{ >-#if ENABLE(INSPECTOR) >- m_webPage->corePage()->inspectorController()->didBeginFrame(); >-#endif >- >-#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) && !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >- // Make sure that any previously registered animation callbacks are being executed before we flush the layers. >- m_lastAnimationServiceTime = WTF::monotonicallyIncreasingTime(); >- m_webPage->corePage()->mainFrame()->view()->serviceScriptedAnimations(m_lastAnimationServiceTime); >-#endif >+ bool didSync = m_coordinator->flushPendingLayerChanges(); > >- m_webPage->layoutIfNeeded(); >-} >+ if (m_forceRepaintAsyncCallbackID) { >+ m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID)); >+ m_forceRepaintAsyncCallbackID = 0; >+ } > >-void CoordinatedLayerTreeHost::didPerformScheduledLayerFlush() >-{ >- if (m_notifyAfterScheduledLayerFlush) { >+ if (m_notifyAfterScheduledLayerFlush && didSync) { > static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers(); > m_notifyAfterScheduledLayerFlush = false; > } >@@ -452,15 +328,15 @@ void CoordinatedLayerTreeHost::createPageOverlayLayer() > { > ASSERT(!m_pageOverlayLayer); > >- m_pageOverlayLayer = GraphicsLayer::create(this, this); >+ m_pageOverlayLayer = GraphicsLayer::create(graphicsLayerFactory(), m_coordinator.get()); > #ifndef NDEBUG >- m_pageOverlayLayer->setName("CoordinatedLayerTreeHost page overlay content"); >+ m_pageOverlayLayer->setName("CompositingCoordinator page overlay content"); > #endif > > m_pageOverlayLayer->setDrawsContent(true); >- m_pageOverlayLayer->setSize(m_webPage->size()); >+ m_pageOverlayLayer->setSize(m_coordinator->rootLayer()->size()); > >- m_rootLayer->addChild(m_pageOverlayLayer.get()); >+ m_coordinator->rootLayer()->addChild(m_pageOverlayLayer.get()); > } > > void CoordinatedLayerTreeHost::destroyPageOverlayLayer() >@@ -470,65 +346,7 @@ void CoordinatedLayerTreeHost::destroyPageOverlayLayer() > m_pageOverlayLayer = nullptr; > } > >-PassRefPtr<CoordinatedImageBacking> CoordinatedLayerTreeHost::createImageBackingIfNeeded(Image* image) >-{ >- CoordinatedImageBackingID imageID = CoordinatedImageBacking::getCoordinatedImageBackingID(image); >- ImageBackingMap::iterator it = m_imageBackings.find(imageID); >- RefPtr<CoordinatedImageBacking> imageBacking; >- if (it == m_imageBackings.end()) { >- imageBacking = CoordinatedImageBacking::create(this, image); >- m_imageBackings.add(imageID, imageBacking); >- } else >- imageBacking = it->value; >- >- return imageBacking; >-} >- >-void CoordinatedLayerTreeHost::createImageBacking(CoordinatedImageBackingID imageID) >-{ >- m_state.imagesToCreate.append(imageID); >-} >- >-void CoordinatedLayerTreeHost::updateImageBacking(CoordinatedImageBackingID imageID, PassRefPtr<CoordinatedSurface> coordinatedSurface) >-{ >- m_shouldSyncFrame = true; >- m_state.imagesToUpdate.append(std::make_pair(imageID, coordinatedSurface)); >-} >- >-void CoordinatedLayerTreeHost::clearImageBackingContents(CoordinatedImageBackingID imageID) >-{ >- m_shouldSyncFrame = true; >- m_state.imagesToClear.append(imageID); >-} >- >-void CoordinatedLayerTreeHost::removeImageBacking(CoordinatedImageBackingID imageID) >-{ >- if (m_isPurging) >- return; >- >- ASSERT(m_imageBackings.contains(imageID)); >- m_imageBackings.remove(imageID); >- >- m_state.imagesToRemove.append(imageID); >-} >- >-void CoordinatedLayerTreeHost::flushPendingImageBackingChanges() >-{ >- ImageBackingMap::iterator end = m_imageBackings.end(); >- for (ImageBackingMap::iterator iter = m_imageBackings.begin(); iter != end; ++iter) >- iter->value->update(); >-} >- >-void CoordinatedLayerTreeHost::notifyAnimationStarted(const WebCore::GraphicsLayer*, double /* time */) >-{ >-} >- >-void CoordinatedLayerTreeHost::notifyFlushRequired(const WebCore::GraphicsLayer*) >-{ >- scheduleLayerFlush(); >-} >- >-void CoordinatedLayerTreeHost::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext& graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect) >+void CoordinatedLayerTreeHost::paintLayerContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, const IntRect& clipRect) > { > if (graphicsLayer == m_pageOverlayLayer) { > // Overlays contain transparent contents and won't clear the context as part of their rendering, so we do it here. >@@ -538,15 +356,10 @@ void CoordinatedLayerTreeHost::paintContents(const WebCore::GraphicsLayer* graph > } > } > >-PassOwnPtr<GraphicsLayer> CoordinatedLayerTreeHost::createGraphicsLayer(GraphicsLayerClient* client) >+void CoordinatedLayerTreeHost::commitSceneState(WebCore::CoordinatedGraphicsState& state) > { >- CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client); >- layer->setCoordinator(this); >- m_registeredLayers.add(layer->id(), layer); >- m_state.layersToCreate.append(layer->id()); >- layer->setNeedsVisibleRectAdjustment(); >- scheduleLayerFlush(); >- return adoptPtr(layer); >+ m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(state)); >+ m_isWaitingForRenderer = true; > } > > PassRefPtr<CoordinatedSurface> CoordinatedLayerTreeHost::createCoordinatedSurface(const IntSize& size, CoordinatedSurface::Flags flags) >@@ -554,73 +367,14 @@ PassRefPtr<CoordinatedSurface> CoordinatedLayerTreeHost::createCoordinatedSurfac > return WebCoordinatedSurface::create(size, flags); > } > >-float CoordinatedLayerTreeHost::deviceScaleFactor() const >-{ >- return m_webPage->deviceScaleFactor(); >-} >- >-float CoordinatedLayerTreeHost::pageScaleFactor() const >-{ >- return m_webPage->pageScaleFactor(); >-} >- > bool LayerTreeHost::supportsAcceleratedCompositing() > { > return true; > } > >-void CoordinatedLayerTreeHost::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> coordinatedSurface) >-{ >- m_state.updateAtlasesToCreate.append(std::make_pair(atlasID, coordinatedSurface)); >-} >- >-void CoordinatedLayerTreeHost::removeUpdateAtlas(uint32_t atlasID) >-{ >- if (m_isPurging) >- return; >- m_state.updateAtlasesToRemove.append(atlasID); >-} >- >-WebCore::FloatRect CoordinatedLayerTreeHost::visibleContentsRect() const >-{ >- return m_visibleContentsRect; >-} >- >-CoordinatedGraphicsLayer* CoordinatedLayerTreeHost::mainContentsLayer() >-{ >- if (!m_rootCompositingLayer) >- return 0; >- >- return toCoordinatedGraphicsLayer(m_rootCompositingLayer)->findFirstDescendantWithContentsRecursively(); >-} >- >-void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector) >-{ >- // A zero trajectoryVector indicates that tiles all around the viewport are requested. >- if (CoordinatedGraphicsLayer* contentsLayer = mainContentsLayer()) >- contentsLayer->setVisibleContentRectTrajectoryVector(trajectoryVector); >- >- bool contentsRectDidChange = rect != m_visibleContentsRect; >- if (contentsRectDidChange) { >- m_visibleContentsRect = rect; >- >- LayerMap::iterator end = m_registeredLayers.end(); >- for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) { >- it->value->setNeedsVisibleRectAdjustment(); >- } >- } >- >- scheduleLayerFlush(); >- if (m_webPage->useFixedLayout()) { >- // Round the rect instead of enclosing it to make sure that its size stays >- // the same while panning. This can have nasty effects on layout. >- m_webPage->setFixedVisibleContentRect(roundedIntRect(rect)); >- } >-} >- > void CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged() > { >- m_rootLayer->deviceOrPageScaleFactorChanged(); >+ m_coordinator->deviceOrPageScaleFactorChanged(); > if (m_pageOverlayLayer) > m_pageOverlayLayer->deviceOrPageScaleFactorChanged(); > } >@@ -631,95 +385,23 @@ void CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged() > > GraphicsLayerFactory* CoordinatedLayerTreeHost::graphicsLayerFactory() > { >- return this; >+ return m_coordinator.get(); > } > > #if ENABLE(REQUEST_ANIMATION_FRAME) > void CoordinatedLayerTreeHost::scheduleAnimation() > { >- if (m_waitingForUIProcess) >+ if (m_isWaitingForRenderer) > return; > > if (m_layerFlushTimer.isActive()) > return; > >- // According to the requestAnimationFrame spec, rAF callbacks should not be faster than 60FPS. >- static const double MinimalTimeoutForAnimations = 1. / 60.; >- m_layerFlushTimer.startOneShot(std::max<double>(0., MinimalTimeoutForAnimations - WTF::monotonicallyIncreasingTime() + m_lastAnimationServiceTime)); >+ m_layerFlushTimer.startOneShot(m_coordinator->nextAnimationServiceTime()); > scheduleLayerFlush(); > } > #endif > >-void CoordinatedLayerTreeHost::renderNextFrame() >-{ >- m_waitingForUIProcess = false; >- scheduleLayerFlush(); >- for (unsigned i = 0; i < m_updateAtlases.size(); ++i) >- m_updateAtlases[i]->didSwapBuffers(); >-} >- >-void CoordinatedLayerTreeHost::purgeBackingStores() >-{ >- TemporaryChange<bool> purgingToggle(m_isPurging, true); >- >- LayerMap::iterator end = m_registeredLayers.end(); >- for (LayerMap::iterator it = m_registeredLayers.begin(); it != end; ++it) >- it->value->purgeBackingStores(); >- >- m_imageBackings.clear(); >- m_updateAtlases.clear(); >-} >- >-bool CoordinatedLayerTreeHost::paintToSurface(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset, CoordinatedSurface::Client* client) >-{ >- for (unsigned i = 0; i < m_updateAtlases.size(); ++i) { >- UpdateAtlas* atlas = m_updateAtlases[i].get(); >- if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) { >- // This will false if there is no available buffer space. >- if (atlas->paintOnAvailableBuffer(size, atlasID, offset, client)) >- return true; >- } >- } >- >- static const int ScratchBufferDimension = 1024; // Should be a power of two. >- m_updateAtlases.append(adoptPtr(new UpdateAtlas(this, ScratchBufferDimension, flags))); >- scheduleReleaseInactiveAtlases(); >- return m_updateAtlases.last()->paintOnAvailableBuffer(size, atlasID, offset, client); >-} >- >-const double ReleaseInactiveAtlasesTimerInterval = 0.5; >- >-void CoordinatedLayerTreeHost::scheduleReleaseInactiveAtlases() >-{ >- if (!m_releaseInactiveAtlasesTimer.isActive()) >- m_releaseInactiveAtlasesTimer.startRepeating(ReleaseInactiveAtlasesTimerInterval); >-} >- >-void CoordinatedLayerTreeHost::releaseInactiveAtlasesTimerFired(Timer<CoordinatedLayerTreeHost>*) >-{ >- // We always want to keep one atlas for non-composited content. >- OwnPtr<UpdateAtlas> atlasToKeepAnyway; >- bool foundActiveAtlasForNonCompositedContent = false; >- for (int i = m_updateAtlases.size() - 1; i >= 0; --i) { >- UpdateAtlas* atlas = m_updateAtlases[i].get(); >- if (!atlas->isInUse()) >- atlas->addTimeInactive(ReleaseInactiveAtlasesTimerInterval); >- bool usableForNonCompositedContent = !atlas->supportsAlpha(); >- if (atlas->isInactive()) { >- if (!foundActiveAtlasForNonCompositedContent && !atlasToKeepAnyway && usableForNonCompositedContent) >- atlasToKeepAnyway = m_updateAtlases[i].release(); >- m_updateAtlases.remove(i); >- } else if (usableForNonCompositedContent) >- foundActiveAtlasForNonCompositedContent = true; >- } >- >- if (!foundActiveAtlasForNonCompositedContent && atlasToKeepAnyway) >- m_updateAtlases.append(atlasToKeepAnyway.release()); >- >- if (m_updateAtlases.size() <= 1) >- m_releaseInactiveAtlasesTimer.stop(); >-} >- > void CoordinatedLayerTreeHost::setBackgroundColor(const WebCore::Color& color) > { > m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::SetBackgroundColor(color)); >@@ -727,11 +409,7 @@ void CoordinatedLayerTreeHost::setBackgroundColor(const WebCore::Color& color) > > void CoordinatedLayerTreeHost::commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset) > { >- LayerMap::iterator i = m_registeredLayers.find(layerID); >- if (i == m_registeredLayers.end()) >- return; >- >- i->value->commitScrollOffset(offset); >+ m_coordinator->commitScrollOffset(layerID, offset); > } > > } // namespace WebKit >diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h >index 1414f43e8fb6752aa79e90dd342ffb12cc7f3fe2..e8e5648e63a313c60fb04acd4460583ec953e43a 100644 >--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h >+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h >@@ -25,13 +25,8 @@ > > #include "LayerTreeContext.h" > #include "LayerTreeHost.h" >-#include "Timer.h" >-#include <WebCore/CoordinatedGraphicsLayer.h> >-#include <WebCore/CoordinatedGraphicsState.h> >-#include <WebCore/CoordinatedImageBacking.h> >-#include <WebCore/GraphicsLayerClient.h> >+#include <WebCore/CompositingCoordinator.h> > #include <WebCore/GraphicsLayerFactory.h> >-#include <WebCore/UpdateAtlas.h> > #include <wtf/OwnPtr.h> > > #if ENABLE(CSS_SHADERS) >@@ -46,11 +41,7 @@ namespace WebKit { > > class WebPage; > >-class CoordinatedLayerTreeHost : public LayerTreeHost, WebCore::GraphicsLayerClient >- , public WebCore::CoordinatedGraphicsLayerClient >- , public WebCore::CoordinatedImageBacking::Client >- , public WebCore::UpdateAtlas::Client >- , public WebCore::GraphicsLayerFactory >+class CoordinatedLayerTreeHost : public LayerTreeHost, public WebCore::CompositingCoordinator::Client > #if ENABLE(CSS_SHADERS) > , WebCustomFilterProgramProxyClient > #endif >@@ -84,9 +75,6 @@ public: > virtual void deviceOrPageScaleFactorChanged() OVERRIDE; > virtual void pageBackgroundTransparencyChanged() OVERRIDE; > >- virtual void renderNextFrame(); >- virtual void purgeBackingStores(); >- virtual void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&); > virtual void didReceiveCoordinatedLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&); > virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() OVERRIDE; > WebCore::CoordinatedGraphicsLayer* mainContentsLayer(); >@@ -98,60 +86,31 @@ public: > > static PassRefPtr<WebCore::CoordinatedSurface> createCoordinatedSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags); > >- void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset); >- > protected: > explicit CoordinatedLayerTreeHost(WebPage*); > > private: >- // GraphicsLayerClient >- virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time); >- virtual void notifyFlushRequired(const WebCore::GraphicsLayer*); >- virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect); >- virtual float deviceScaleFactor() const OVERRIDE; >- virtual float pageScaleFactor() const OVERRIDE; >- >- // CoordinatedImageBacking::Client >- virtual void createImageBacking(WebCore::CoordinatedImageBackingID) OVERRIDE; >- virtual void updateImageBacking(WebCore::CoordinatedImageBackingID, PassRefPtr<WebCore::CoordinatedSurface>) OVERRIDE; >- virtual void clearImageBackingContents(WebCore::CoordinatedImageBackingID) OVERRIDE; >- virtual void removeImageBacking(WebCore::CoordinatedImageBackingID) OVERRIDE; >- >- void flushPendingImageBackingChanges(); >- >- // CoordinatedGraphicsLayerClient >- virtual bool isFlushingLayerChanges() const OVERRIDE { return m_isFlushingLayerChanges; } >- virtual WebCore::FloatRect visibleContentsRect() const; >- virtual PassRefPtr<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image*) OVERRIDE; >- virtual void detachLayer(WebCore::CoordinatedGraphicsLayer*); >- virtual bool paintToSurface(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& /* atlasID */, WebCore::IntPoint&, WebCore::CoordinatedSurface::Client*) OVERRIDE; >- virtual void syncLayerState(WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayerState&); >- >- // UpdateAtlas::Client >- virtual void createUpdateAtlas(uint32_t atlasID, PassRefPtr<WebCore::CoordinatedSurface>) OVERRIDE; >- virtual void removeUpdateAtlas(uint32_t atlasID) OVERRIDE; >- >- // GraphicsLayerFactory >- virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE; >- > // CoordinatedLayerTreeHost >- void initializeRootCompositingLayerIfNeeded(); > void createPageOverlayLayer(); > void destroyPageOverlayLayer(); >- bool flushPendingLayerChanges(); >- void clearPendingStateChanges(); > void cancelPendingLayerFlush(); > void performScheduledLayerFlush(); >- void didPerformScheduledLayerFlush(); >- void syncDisplayState(); >- void layerFlushTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*); >+ void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&); >+ void renderNextFrame(); >+ void purgeBackingStores(); >+ void commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset); > >- void scheduleReleaseInactiveAtlases(); >+ void layerFlushTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*); > >- void releaseInactiveAtlasesTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*); >+ // CompositingCoordinator::Client >+ virtual void didFlushRootLayer() OVERRIDE; >+ virtual void willSyncLayerState(WebCore::CoordinatedGraphicsLayerState&) OVERRIDE; >+ virtual void notifyFlushRequired() OVERRIDE { scheduleLayerFlush(); }; >+ virtual void commitSceneState(WebCore::CoordinatedGraphicsState&) OVERRIDE; >+ virtual void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::IntRect& clipRect) OVERRIDE; > > #if ENABLE(CSS_SHADERS) >- void prepareCustomFilterProxiesIfNeeded(WebCore::CoordinatedGraphicsLayerState&); >+ void prepareCustomFilterProxiesForAnimations(WebCore::GraphicsLayerAnimations&); > > // WebCustomFilterProgramProxyClient > void removeCustomFilterProgramProxy(WebCustomFilterProgramProxy*); >@@ -160,47 +119,26 @@ private: > void disconnectCustomFilterPrograms(); > #endif > >- OwnPtr<WebCore::GraphicsLayer> m_rootLayer; >- WebCore::GraphicsLayer* m_rootCompositingLayer; >+ OwnPtr<WebCore::CompositingCoordinator> m_coordinator; > > // The page overlay layer. Will be null if there's no page overlay. > OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer; > RefPtr<PageOverlay> m_pageOverlay; > >- WebCore::CoordinatedGraphicsState m_state; >- >- typedef HashMap<WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayer*> LayerMap; >- LayerMap m_registeredLayers; >- typedef HashMap<WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedImageBacking> > ImageBackingMap; >- ImageBackingMap m_imageBackings; >- Vector<OwnPtr<WebCore::UpdateAtlas> > m_updateAtlases; >- > #if ENABLE(CSS_SHADERS) > HashSet<WebCustomFilterProgramProxy*> m_customFilterPrograms; > #endif > > bool m_notifyAfterScheduledLayerFlush; > bool m_isValid; >- // We don't send the messages related to releasing resources to UI Process during purging, because UI Process already had removed all resources. >- bool m_isPurging; >- bool m_isFlushingLayerChanges; >- >- bool m_waitingForUIProcess; > bool m_isSuspended; >- WebCore::FloatRect m_visibleContentsRect; >+ bool m_isWaitingForRenderer; > > LayerTreeContext m_layerTreeContext; >- bool m_shouldSyncFrame; >- bool m_didInitializeRootCompositingLayer; >+ > WebCore::Timer<CoordinatedLayerTreeHost> m_layerFlushTimer; >- WebCore::Timer<CoordinatedLayerTreeHost> m_releaseInactiveAtlasesTimer; > bool m_layerFlushSchedulingEnabled; > uint64_t m_forceRepaintAsyncCallbackID; >- bool m_animationsLocked; >- >-#if ENABLE(REQUEST_ANIMATION_FRAME) >- double m_lastAnimationServiceTime; >-#endif > }; > > } // namespace WebKit >diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h >index 90bbb941d1ab05681f96a21402cf93481b32777d..2fad2d13cf25d836ecfaba3abfe6af8980240a26 100644 >--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h >+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h >@@ -87,9 +87,6 @@ public: > virtual void setBackgroundColor(const WebCore::Color&) { } > > #if USE(COORDINATED_GRAPHICS) >- virtual void setVisibleContentsRect(const WebCore::FloatRect&, float /* scale */, const WebCore::FloatPoint&) { } >- virtual void renderNextFrame() { } >- virtual void purgeBackingStores() { } > virtual void didReceiveCoordinatedLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) = 0; > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 104360
:
178194
|
178339
|
178512
|
178863
|
182305
|
192909
|
193083
|
203804
|
203920
|
204012
|
204024
|
204029
|
205472
|
205548
|
205715