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-20130313215702.patch (text/plain), 63.11 KB, created by
Gwang Yoon Hwang
on 2013-03-13 06:01:04 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gwang Yoon Hwang
Created:
2013-03-13 06:01:04 PDT
Size:
63.11 KB
patch
obsolete
>Subversion Revision: 145680 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a61197e6fce2af03b29c12bb6ca2b4a69bf9173a..55f18a3839e7f1f1208d11c05c9295d4f6b58e9b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,70 @@ >+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. >+ >+ By creating a new class called CompositingCoordinator, which takes the >+ responsibility of managing compositing resources in WebProcess, >+ CoordinatedLayerTreeHost 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): >+ (WebCore::CompositingCoordinator::~CompositingCoordinator): >+ (WebCore::CompositingCoordinator::CompositingCoordinator): >+ (WebCore::CompositingCoordinator::sizeDidChange): >+ (WebCore::CompositingCoordinator::flushCompositingStateForNonFrameLayers): >+ (WebCore::CompositingCoordinator::flushPendingLayerChanges): >+ (WebCore::CompositingCoordinator::clearPendingStateChanges): >+ (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::createGraphicsLayer): >+ (WebCore::CompositingCoordinator::deviceScaleFactor): >+ (WebCore::CompositingCoordinator::pageScaleFactor): >+ (WebCore::CompositingCoordinator::createUpdateAtlas): >+ (WebCore::CompositingCoordinator::removeUpdateAtlas): >+ (WebCore::CompositingCoordinator::visibleContentsRect): >+ (WebCore::CompositingCoordinator::setVisibleContentsRect): >+ (WebCore::CompositingCoordinator::deviceOrPageScaleFactorChanged): >+ (WebCore::CompositingCoordinator::detachLayer): >+ (WebCore::CompositingCoordinator::setBackgroundColor): >+ (WebCore::CompositingCoordinator::commitScrollOffset): >+ (WebCore::CompositingCoordinator::animationFrameReady): >+ (WebCore::CompositingCoordinator::renderNextFrame): >+ (WebCore::CompositingCoordinator::purgeBackingStores): >+ (WebCore::CompositingCoordinator::beginContentUpdate): >+ (WebCore::CompositingCoordinator::scheduleReleaseInactiveAtlases): >+ (WebCore::CompositingCoordinator::releaseInactiveAtlasesTimerFired): >+ * platform/graphics/texmap/coordinated/CompositingCoordinator.h: Added. >+ (WebCore): >+ (CompositingCoordinator): >+ (WebCore::CompositingCoordinator::clearRootLayer): >+ (WebCore::CompositingCoordinator::rootLayer): >+ (WebCore::CompositingCoordinator::nonCompositedContentLayer): >+ (WebCore::CompositingCoordinator::state): >+ (WebCore::CompositingCoordinator::isWaitingForRenderer): >+ > 2013-03-10 Gwang Yoon Hwang <ryumiel@company100.net> > > Coordinated Graphics: Rename client classes for CoordinatedImageBacking and UpdateAtlas. >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 4dee743a0da889aaa24f811b970a2d90a3e61278..c02b60f9b35a555b6666666a25cd917af82690a9 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,47 @@ >+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. >+ >+ By creating a new class called CompositingCoordinator, which takes the >+ responsibility of managing compositing resources in WebProcess, >+ CoordinatedLayerTreeHost 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::setNonCompositedContentsNeedDisplay): >+ (WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect): >+ (WebKit::CoordinatedLayerTreeHost::sizeDidChange): >+ (WebKit::CoordinatedLayerTreeHost::checkCustomFilterProgramProxies): >+ (WebKit::CoordinatedLayerTreeHost::removeCustomFilterProgramProxy): >+ (WebKit::CoordinatedLayerTreeHost::flushCompositingStateForNonFrameLayers): >+ (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush): >+ (WebKit::CoordinatedLayerTreeHost::createPageOverlayLayer): >+ (WebKit::CoordinatedLayerTreeHost::paintContents): >+ (WebKit::CoordinatedLayerTreeHost::commitCoordinatedGraphicsState): >+ (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): >+ (WebKit::CoordinatedLayerTreeHost::scheduleAnimation): >+ (WebKit): >+ (WebKit::CoordinatedLayerTreeHost::setBackgroundColor): >+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: >+ * WebProcess/WebPage/LayerTreeHost.h: >+ (LayerTreeHost): >+ > 2013-03-10 Gwang Yoon Hwang <ryumiel@company100.net> > > Coordinated Graphics: Rename client classes for CoordinatedImageBacking and UpdateAtlas. >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 4a051e7fd7a970e22e75acc68e1ad974c5bdfee9..c1dc3af88dc3fc6571b0180c370c467d06c0948c 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -2007,6 +2007,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 bfb87acb2ffda2bb8735b2d1c8862cc64e0a2cc7..237bbffad310779eda6f733728da7fe7503eb007 100644 >--- a/Source/WebCore/Target.pri >+++ b/Source/WebCore/Target.pri >@@ -4121,6 +4121,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 \ >@@ -4147,6 +4148,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..3a578e506c3d7f5309511ab77a156b8e3f5e2313 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp >@@ -0,0 +1,407 @@ >+/* >+ * 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 "Page.h" >+#include "Settings.h" >+#include <wtf/TemporaryChange.h> >+ >+namespace WebCore { >+ >+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) >+ : m_page(page) >+ , m_isPurging(false) >+ , m_isFlushingLayerChanges(false) >+ , m_isWaitingForRenderer(true) >+ , m_shouldSyncFrame(false) >+ , m_releaseInactiveAtlasesTimer(this, &CompositingCoordinator::releaseInactiveAtlasesTimerFired) >+{ >+ m_page->settings()->setScrollingCoordinatorEnabled(true); >+ m_page->settings()->setApplyDeviceScaleFactorInCompositor(true); >+} >+ >+void CompositingCoordinator::sizeDidChange(const IntSize& newSize) >+{ >+ if (m_rootLayer->size() == newSize) >+ return; >+ >+ m_rootLayer->setSize(newSize); >+ >+ // If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed >+ // for those newly exposed areas. >+ FloatSize oldSize = m_nonCompositedContentLayer->size(); >+ m_nonCompositedContentLayer->setSize(newSize); >+ >+ if (newSize.width() > oldSize.width()) { >+ float height = std::min(static_cast<float>(newSize.height()), oldSize.height()); >+ m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height)); >+ } >+ >+ if (newSize.height() > oldSize.height()) >+ m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height())); >+} >+ >+ >+void CompositingCoordinator::flushCompositingStateForNonFrameLayers() >+{ >+ m_rootLayer->flushCompositingStateForThisLayerOnly(); >+ m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly(); >+} >+ >+bool CompositingCoordinator::flushPendingLayerChanges() >+{ >+ if (m_isWaitingForRenderer) >+ return false; >+ >+ TemporaryChange<bool> protector(m_isFlushingLayerChanges, true); >+ >+ flushCompositingStateForNonFrameLayers(); >+ >+ bool didSync = m_page->mainFrame()->view()->flushCompositingStateIncludingSubframes(); >+ >+ flushPendingImageBackingChanges(); >+ >+ if (m_shouldSyncFrame) { >+ didSync = true; >+ >+ m_state.contentsSize = roundedIntSize(m_nonCompositedContentLayer->size()); >+ m_state.coveredRect = toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->coverRect(); >+ m_state.scrollPosition = m_visibleContentsRect.location(); >+ >+ commitCoordinatedGraphicsState(m_state); >+ >+ clearPendingStateChanges(); >+ m_isWaitingForRenderer = true; >+ m_shouldSyncFrame = false; >+ } >+ >+ return didSync; >+} >+ >+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::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); >+ >+ m_nonCompositedContentLayer = GraphicsLayer::create(this, this); >+#ifndef NDEBUG >+ m_nonCompositedContentLayer->setName("CompositingCoordinator non-composited content"); >+#endif >+ m_nonCompositedContentLayer->setDrawsContent(true); >+ m_nonCompositedContentLayer->setSize(size); >+ >+ m_nonCompositedContentLayer->setShowDebugBorder(m_page->settings()->showDebugBorders()); >+ m_nonCompositedContentLayer->setShowRepaintCounter(m_page->settings()->showRepaintCounter()); >+ >+ m_rootLayer->addChild(m_nonCompositedContentLayer.get()); >+ >+ m_state.rootCompositingLayer = toCoordinatedGraphicsLayer(m_rootLayer.get())->id(); >+ m_shouldSyncFrame = true; >+} >+ >+void CompositingCoordinator::syncLayerState(CoordinatedLayerID id, CoordinatedGraphicsLayerState& state) >+{ >+ m_shouldSyncFrame = true; >+ >+#if ENABLE(CSS_SHADERS) >+ prepareCustomFilterProxiesIfNeeded(state); >+#endif >+ >+ 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_state.imagesToUpdate.append(std::make_pair(imageID, coordinatedSurface)); >+} >+ >+void CompositingCoordinator::clearImageBackingContents(CoordinatedImageBackingID imageID) >+{ >+ 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*) >+{ >+ scheduleLayerFlushRequired(); >+} >+ >+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(); >+ scheduleLayerFlushRequired(); >+ 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; >+} >+ >+void CompositingCoordinator::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector) >+{ >+ // A zero trajectoryVector indicates that tiles all around the viewport are requested. >+ toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->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(); >+ } >+ >+ scheduleLayerFlushRequired(); >+} >+ >+void CompositingCoordinator::deviceOrPageScaleFactorChanged() >+{ >+ m_rootLayer->deviceOrPageScaleFactorChanged(); >+ m_nonCompositedContentLayer->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()); >+ scheduleLayerFlushRequired(); >+} >+ >+void CompositingCoordinator::setBackgroundColor(const WebCore::Color& color) >+{ >+ m_shouldSyncFrame = true; >+ m_state.backgroundColor = color; >+} >+ >+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); >+} >+ >+#if ENABLE(REQUEST_ANIMATION_FRAME) >+void CompositingCoordinator::animationFrameReady() >+{ >+ scheduleLayerFlushRequired(); >+} >+#endif >+ >+void CompositingCoordinator::renderNextFrame() >+{ >+ m_isWaitingForRenderer = false; >+ scheduleLayerFlushRequired(); >+ 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(); >+} >+ >+PassOwnPtr<GraphicsContext> CompositingCoordinator::beginContentUpdate(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset) >+{ >+ OwnPtr<GraphicsContext> graphicsContext; >+ for (unsigned i = 0; i < m_updateAtlases.size(); ++i) { >+ UpdateAtlas* atlas = m_updateAtlases[i].get(); >+ if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) { >+ // This will return null if there is no available buffer space. >+ graphicsContext = atlas->beginPaintingOnAvailableBuffer(atlasID, size, offset); >+ if (graphicsContext) >+ return graphicsContext.release(); >+ } >+ } >+ >+ 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()->beginPaintingOnAvailableBuffer(atlasID, size, offset); >+} >+ >+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..96b1a1ac31674dccddd5d6bb10a4e45638e2d001 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h >@@ -0,0 +1,159 @@ >+/* >+ * 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 GraphicsLayer; >+class CoordinatedSurface; >+ >+class CompositingCoordinator : public GraphicsLayerClient >+ , public CoordinatedGraphicsLayerClient >+ , public CoordinatedImageBacking::Client >+ , public UpdateAtlas::Client >+ , public GraphicsLayerFactory { >+public: >+ virtual ~CompositingCoordinator(); >+ >+protected: >+ CompositingCoordinator(Page*); >+ >+ void sizeDidChange(const IntSize& newSize); >+ void deviceOrPageScaleFactorChanged(); >+ void setBackgroundColor(const Color&); >+ >+ void setVisibleContentsRect(const FloatRect&, const FloatPoint&); >+ void renderNextFrame(); >+ void purgeBackingStores(); >+ void commitScrollOffset(uint32_t layerID, const IntSize& offset); >+#if ENABLE(REQUEST_ANIMATION_FRAME) >+ void animationFrameReady(); >+#endif >+ >+ void createRootLayer(const IntSize&); >+ void clearRootLayer() { m_rootLayer = nullptr; } >+ GraphicsLayer* rootLayer() const { return m_rootLayer.get(); } >+ GraphicsLayer* nonCompositedContentLayer() const { return m_nonCompositedContentLayer.get(); } >+ >+ bool flushPendingLayerChanges(); >+ CoordinatedGraphicsState& state() { return m_state; } >+ bool isWaitingForRenderer() const { return m_isWaitingForRenderer; } >+ >+ virtual void flushCompositingStateForNonFrameLayers(); >+ virtual void scheduleLayerFlushRequired() = 0; >+ virtual void commitCoordinatedGraphicsState(CoordinatedGraphicsState&) = 0; >+#if ENABLE(CSS_SHADERS) >+ virtual void prepareCustomFilterProxiesIfNeeded(CoordinatedGraphicsLayerState&) = 0; >+#endif >+ >+private: >+ // 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) = 0; >+ 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 PassOwnPtr<GraphicsContext> beginContentUpdate(const IntSize&, CoordinatedSurface::Flags, uint32_t& atlasID, IntPoint&) 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 flushPendingImageBackingChanges(); >+ void clearPendingStateChanges(); >+ >+ void scheduleReleaseInactiveAtlases(); >+ >+ void releaseInactiveAtlasesTimerFired(Timer<CompositingCoordinator>*); >+ >+ Page* m_page; >+ >+ OwnPtr<GraphicsLayer> m_rootLayer; >+ >+ // The layer which contains all non-composited content. >+ OwnPtr<GraphicsLayer> m_nonCompositedContentLayer; >+ >+ 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; >+ >+ bool m_isWaitingForRenderer; >+ FloatRect m_visibleContentsRect; >+ >+ bool m_shouldSyncFrame; >+ bool m_didInitializeRootCompositingLayer; >+ Timer<CompositingCoordinator> m_releaseInactiveAtlasesTimer; >+}; >+ >+} >+ >+#endif >+ >+#endif // CompositingCoordinator_h >diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp >index c639453d437a1dcfef3ea01c087f4172727ee127..141ee9c4cfae1ce92d6bcc6a004a6a076af52d1f 100644 >--- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp >+++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp >@@ -38,18 +38,6 @@ > #include "WebCoreArgumentCoders.h" > #include "WebPage.h" > #include "WebPageProxyMessages.h" >-#include <WebCore/Frame.h> >-#include <WebCore/FrameView.h> >-#include <WebCore/GraphicsSurface.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/TemporaryChange.h> > > #if ENABLE(CSS_SHADERS) > #include "CustomFilterValidatedProgram.h" >@@ -70,53 +58,21 @@ 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) >+ , CompositingCoordinator(webPage->corePage()) > , 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_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired) >- , m_releaseInactiveAtlasesTimer(this, &CoordinatedLayerTreeHost::releaseInactiveAtlasesTimerFired) > , m_layerFlushSchedulingEnabled(true) > , m_forceRepaintAsyncCallbackID(0) > , m_animationsLocked(false) > { >- m_webPage->corePage()->settings()->setScrollingCoordinatorEnabled(true); >- m_webPage->corePage()->settings()->setApplyDeviceScaleFactorInCompositor(true); >- >- // Create a root layer. >- m_rootLayer = GraphicsLayer::create(this, this); >- CoordinatedGraphicsLayer* coordinatedRootLayer = toCoordinatedGraphicsLayer(m_rootLayer.get()); >-#ifndef NDEBUG >- m_rootLayer->setName("CoordinatedLayerTreeHost root layer"); >-#endif >- m_rootLayer->setDrawsContent(false); >- m_rootLayer->setSize(m_webPage->size()); >- m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(coordinatedRootLayer)->id(); >- >- m_nonCompositedContentLayer = GraphicsLayer::create(this, this); >-#ifndef NDEBUG >- m_nonCompositedContentLayer->setName("CoordinatedLayerTreeHost non-composited content"); >-#endif >- m_nonCompositedContentLayer->setDrawsContent(true); >- m_nonCompositedContentLayer->setSize(m_webPage->size()); >- >- m_nonCompositedContentLayer->setShowDebugBorder(m_webPage->corePage()->settings()->showDebugBorders()); >- m_nonCompositedContentLayer->setShowRepaintCounter(m_webPage->corePage()->settings()->showRepaintCounter()); >- >- m_rootLayer->addChild(m_nonCompositedContentLayer.get()); >+ createRootLayer(m_webPage->size()); >+ m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(CompositingCoordinator::rootLayer())->id(); > > CoordinatedSurface::setFactory(createCoordinatedSurface); > >@@ -162,12 +118,12 @@ void CoordinatedLayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush(bool > > void CoordinatedLayerTreeHost::setRootCompositingLayer(WebCore::GraphicsLayer* graphicsLayer) > { >- m_nonCompositedContentLayer->removeAllChildren(); >- m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground()); >+ nonCompositedContentLayer()->removeAllChildren(); >+ nonCompositedContentLayer()->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground()); > > // Add the accelerated layer tree hierarchy. > if (graphicsLayer) >- m_nonCompositedContentLayer->addChild(graphicsLayer); >+ nonCompositedContentLayer()->addChild(graphicsLayer); > } > > void CoordinatedLayerTreeHost::invalidate() >@@ -175,13 +131,14 @@ void CoordinatedLayerTreeHost::invalidate() > cancelPendingLayerFlush(); > > ASSERT(m_isValid); >- m_rootLayer = nullptr; >+ clearRootLayer(); > m_isValid = false; > } > > void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay() > { >- m_nonCompositedContentLayer->setNeedsDisplay(); >+ nonCompositedContentLayer()->setNeedsDisplay(); >+ > if (m_pageOverlayLayer) > m_pageOverlayLayer->setNeedsDisplay(); > >@@ -190,7 +147,8 @@ void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay() > > void CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect& rect) > { >- m_nonCompositedContentLayer->setNeedsDisplayInRect(rect); >+ nonCompositedContentLayer()->setNeedsDisplayInRect(rect); >+ > if (m_pageOverlayLayer) > m_pageOverlayLayer->setNeedsDisplayInRect(rect); > >@@ -228,23 +186,7 @@ bool CoordinatedLayerTreeHost::forceRepaintAsync(uint64_t callbackID) > > void CoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize& newSize) > { >- if (m_rootLayer->size() == newSize) >- return; >- >- m_rootLayer->setSize(newSize); >- >- // If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed >- // for those newly exposed areas. >- FloatSize oldSize = m_nonCompositedContentLayer->size(); >- m_nonCompositedContentLayer->setSize(newSize); >- >- if (newSize.width() > oldSize.width()) { >- float height = std::min(static_cast<float>(newSize.height()), oldSize.height()); >- m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height)); >- } >- >- if (newSize.height() > oldSize.height()) >- m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height())); >+ CompositingCoordinator::sizeDidChange(newSize); > > if (m_pageOverlayLayer) > m_pageOverlayLayer->setSize(newSize); >@@ -278,88 +220,6 @@ void CoordinatedLayerTreeHost::setPageOverlayOpacity(float value) > scheduleLayerFlush(); > } > >-bool CoordinatedLayerTreeHost::flushPendingLayerChanges() >-{ >- if (m_waitingForUIProcess) >- return false; >- >- TemporaryChange<bool> protector(m_isFlushingLayerChanges, true); >- >- initializeRootCompositingLayerIfNeeded(); >- >- m_rootLayer->flushCompositingStateForThisLayerOnly(); >- m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly(); >- if (m_pageOverlayLayer) >- m_pageOverlayLayer->flushCompositingStateForThisLayerOnly(); >- >- bool didSync = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes(); >- >- flushPendingImageBackingChanges(); >- >- if (m_shouldSyncFrame) { >- didSync = true; >- >- m_state.contentsSize = roundedIntSize(m_nonCompositedContentLayer->size()); >- m_state.coveredRect = toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->coverRect(); >- m_state.scrollPosition = m_visibleContentsRect.location(); >- >- m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(m_state)); >- >- clearPendingStateChanges(); >- m_waitingForUIProcess = true; >- m_shouldSyncFrame = false; >- } else >- unlockAnimations(); >- >- if (m_forceRepaintAsyncCallbackID) { >- m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID)); >- m_forceRepaintAsyncCallbackID = 0; >- } >- >- return didSync; >-} >- >-void CoordinatedLayerTreeHost::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 CoordinatedLayerTreeHost::initializeRootCompositingLayerIfNeeded() >-{ >- if (m_didInitializeRootCompositingLayer) >- return; >- >- m_state.rootCompositingLayer = toCoordinatedGraphicsLayer(m_rootLayer.get())->id(); >- m_didInitializeRootCompositingLayer = true; >- m_shouldSyncFrame = true; >-} >- >-void CoordinatedLayerTreeHost::syncLayerState(CoordinatedLayerID id, CoordinatedGraphicsLayerState& state) >-{ >- m_shouldSyncFrame = true; >- >-#if ENABLE(CSS_SHADERS) >- prepareCustomFilterProxiesIfNeeded(state); >-#endif >- >- m_state.layersToUpdate.append(std::make_pair(id, state)); >-} >- > #if ENABLE(CSS_SHADERS) > void CoordinatedLayerTreeHost::prepareCustomFilterProxiesIfNeeded(CoordinatedGraphicsLayerState& state) > { >@@ -407,7 +267,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())); >+ 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); >@@ -420,7 +280,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()); >+ state().customFiltersToRemove.append(customFilterProgramProxy->id()); > } > > void CoordinatedLayerTreeHost::disconnectCustomFilterPrograms() >@@ -432,21 +292,11 @@ void CoordinatedLayerTreeHost::disconnectCustomFilterPrograms() > } > #endif // ENABLE(CSS_SHADERS) > >-void CoordinatedLayerTreeHost::detachLayer(CoordinatedGraphicsLayer* layer) >+void CoordinatedLayerTreeHost::flushCompositingStateForNonFrameLayers() > { >- 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()); >- scheduleLayerFlush(); >+ CompositingCoordinator::flushCompositingStateForNonFrameLayers(); >+ if (m_pageOverlayLayer) >+ m_pageOverlayLayer->flushCompositingStateForThisLayerOnly(); > } > > void CoordinatedLayerTreeHost::lockAnimations() >@@ -466,7 +316,7 @@ void CoordinatedLayerTreeHost::unlockAnimations() > > void CoordinatedLayerTreeHost::performScheduledLayerFlush() > { >- if (m_isSuspended || m_waitingForUIProcess) >+ if (!m_isValid || m_isSuspended || isWaitingForRenderer()) > return; > > // We lock the animations while performing layout, to avoid flickers caused by animations continuing in the UI process while >@@ -476,15 +326,21 @@ void CoordinatedLayerTreeHost::performScheduledLayerFlush() > > // We can unlock the animations before flushing if there are no visible changes, for example if there are content updates > // in a layer with opacity 0. >- bool canUnlockBeforeFlush = !m_isValid || !toCoordinatedGraphicsLayer(m_rootLayer.get())->hasPendingVisibleChanges(); >+ bool canUnlockBeforeFlush = !m_isValid || !toCoordinatedGraphicsLayer(rootLayer())->hasPendingVisibleChanges(); > if (canUnlockBeforeFlush) > unlockAnimations(); > >- if (!m_isValid) >- return; >+ bool didSync = flushPendingLayerChanges(); > >- if (flushPendingLayerChanges()) >- didPerformScheduledLayerFlush(); >+ if (m_forceRepaintAsyncCallbackID) { >+ m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID)); >+ m_forceRepaintAsyncCallbackID = 0; >+ } >+ >+ if (m_notifyAfterScheduledLayerFlush && didSync) { >+ static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers(); >+ m_notifyAfterScheduledLayerFlush = false; >+ } > } > > void CoordinatedLayerTreeHost::syncDisplayState() >@@ -497,14 +353,6 @@ void CoordinatedLayerTreeHost::syncDisplayState() > m_webPage->layoutIfNeeded(); > } > >-void CoordinatedLayerTreeHost::didPerformScheduledLayerFlush() >-{ >- if (m_notifyAfterScheduledLayerFlush) { >- static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers(); >- m_notifyAfterScheduledLayerFlush = false; >- } >-} >- > void CoordinatedLayerTreeHost::layerFlushTimerFired(Timer<CoordinatedLayerTreeHost>*) > { > performScheduledLayerFlush(); >@@ -516,13 +364,13 @@ void CoordinatedLayerTreeHost::createPageOverlayLayer() > > m_pageOverlayLayer = GraphicsLayer::create(this, this); > #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(rootLayer()->size()); > >- m_rootLayer->addChild(m_pageOverlayLayer.get()); >+ rootLayer()->addChild(m_pageOverlayLayer.get()); > } > > void CoordinatedLayerTreeHost::destroyPageOverlayLayer() >@@ -532,65 +380,9 @@ void CoordinatedLayerTreeHost::destroyPageOverlayLayer() > m_pageOverlayLayer = nullptr; > } > >-PassRefPtr<CoordinatedImageBacking> CoordinatedLayerTreeHost::createImageBackingIfNeeded(Image* image) >+void CoordinatedLayerTreeHost::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect) > { >- 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_state.imagesToUpdate.append(std::make_pair(imageID, coordinatedSurface)); >-} >- >-void CoordinatedLayerTreeHost::clearImageBackingContents(CoordinatedImageBackingID imageID) >-{ >- 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) >-{ >- if (graphicsLayer == m_nonCompositedContentLayer) { >+ if (graphicsLayer == nonCompositedContentLayer()) { > m_webPage->drawRect(graphicsContext, clipRect); > return; > } >@@ -603,15 +395,9 @@ void CoordinatedLayerTreeHost::paintContents(const WebCore::GraphicsLayer* graph > } > } > >-PassOwnPtr<GraphicsLayer> CoordinatedLayerTreeHost::createGraphicsLayer(GraphicsLayerClient* client) >+void CoordinatedLayerTreeHost::commitCoordinatedGraphicsState(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)); > } > > PassRefPtr<CoordinatedSurface> CoordinatedLayerTreeHost::createCoordinatedSurface(const IntSize& size, CoordinatedSurface::Flags flags) >@@ -619,65 +405,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; >-} >- >-void CoordinatedLayerTreeHost::setVisibleContentsRect(const FloatRect& rect, const FloatPoint& trajectoryVector) >-{ >- // A zero trajectoryVector indicates that tiles all around the viewport are requested. >- toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->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_nonCompositedContentLayer->deviceOrPageScaleFactorChanged(); >+ CompositingCoordinator::deviceOrPageScaleFactorChanged(); > if (m_pageOverlayLayer) > m_pageOverlayLayer->deviceOrPageScaleFactorChanged(); > } >@@ -692,98 +427,12 @@ void CoordinatedLayerTreeHost::scheduleAnimation() > { > m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::RequestAnimationFrame()); > } >- >-void CoordinatedLayerTreeHost::animationFrameReady() >-{ >- 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(); >-} >- >-PassOwnPtr<GraphicsContext> CoordinatedLayerTreeHost::beginContentUpdate(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset) >-{ >- OwnPtr<GraphicsContext> graphicsContext; >- for (unsigned i = 0; i < m_updateAtlases.size(); ++i) { >- UpdateAtlas* atlas = m_updateAtlases[i].get(); >- if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) { >- // This will return null if there is no available buffer space. >- graphicsContext = atlas->beginPaintingOnAvailableBuffer(atlasID, size, offset); >- if (graphicsContext) >- return graphicsContext.release(); >- } >- } >- >- 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()->beginPaintingOnAvailableBuffer(atlasID, size, offset); >-} >- >-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_shouldSyncFrame = true; >- m_state.backgroundColor = 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); >+ CompositingCoordinator::setBackgroundColor(color); >+ scheduleLayerFlush(); > } > > } // namespace WebKit >diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h >index b7c89e2befc1759d1266c5ed132761f94162a572..81fcbff60213837387c6d9dad84654c00883f73b 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 > #if ENABLE(CSS_SHADERS) > , WebCustomFilterProgramProxyClient > #endif >@@ -59,34 +50,31 @@ public: > static PassRefPtr<CoordinatedLayerTreeHost> create(WebPage*); > virtual ~CoordinatedLayerTreeHost(); > >- virtual const LayerTreeContext& layerTreeContext() { return m_layerTreeContext; } >- virtual void setLayerFlushSchedulingEnabled(bool); >- virtual void scheduleLayerFlush(); >- virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool); >- virtual void setRootCompositingLayer(WebCore::GraphicsLayer*); >- virtual void invalidate(); >+ virtual const LayerTreeContext& layerTreeContext() OVERRIDE { return m_layerTreeContext; } >+ virtual void setLayerFlushSchedulingEnabled(bool) OVERRIDE; >+ virtual void scheduleLayerFlush() OVERRIDE; >+ virtual void setShouldNotifyAfterNextScheduledLayerFlush(bool) OVERRIDE; >+ virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) OVERRIDE; >+ virtual void invalidate() OVERRIDE; > > virtual void setNonCompositedContentsNeedDisplay() OVERRIDE; > virtual void setNonCompositedContentsNeedDisplayInRect(const WebCore::IntRect&) OVERRIDE; > virtual void scrollNonCompositedContents(const WebCore::IntRect&) OVERRIDE; > virtual void forceRepaint(); > virtual bool forceRepaintAsync(uint64_t callbackID); >- virtual void sizeDidChange(const WebCore::IntSize& newSize); >+ virtual void sizeDidChange(const WebCore::IntSize& newSize) OVERRIDE; > >- virtual void didInstallPageOverlay(); >- virtual void didUninstallPageOverlay(); >- virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&); >- virtual void setPageOverlayOpacity(float); >- virtual bool pageOverlayShouldApplyFadeWhenPainting() const { return false; } >+ virtual void didInstallPageOverlay() OVERRIDE; >+ virtual void didUninstallPageOverlay() OVERRIDE; >+ virtual void setPageOverlayNeedsDisplay(const WebCore::IntRect&) OVERRIDE; >+ virtual void setPageOverlayOpacity(float) OVERRIDE; >+ virtual bool pageOverlayShouldApplyFadeWhenPainting() const OVERRIDE { return false; } > >- virtual void pauseRendering() { m_isSuspended = true; } >- virtual void resumeRendering() { m_isSuspended = false; scheduleLayerFlush(); } >+ virtual void pauseRendering() OVERRIDE { m_isSuspended = true; } >+ virtual void resumeRendering() OVERRIDE { m_isSuspended = false; scheduleLayerFlush(); } > virtual void deviceOrPageScaleFactorChanged() OVERRIDE; > >- virtual void renderNextFrame(); >- virtual void purgeBackingStores(); >- virtual void setVisibleContentsRect(const WebCore::FloatRect&, const WebCore::FloatPoint&); >- virtual void didReceiveCoordinatedLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&); >+ virtual void didReceiveCoordinatedLayerTreeHostMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE; > virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() OVERRIDE; > > #if ENABLE(REQUEST_ANIMATION_FRAME) >@@ -96,66 +84,29 @@ 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 PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, WebCore::CoordinatedSurface::Flags, uint32_t& atlasID, WebCore::IntPoint&); >- 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 lockAnimations(); > void unlockAnimations(); > > void layerFlushTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*); > >- void scheduleReleaseInactiveAtlases(); >-#if ENABLE(REQUEST_ANIMATION_FRAME) >- void animationFrameReady(); >-#endif >- >- void releaseInactiveAtlasesTimerFired(WebCore::Timer<CoordinatedLayerTreeHost>*); >+ // CompositingCoordinator >+ virtual void flushCompositingStateForNonFrameLayers() OVERRIDE; >+ virtual void scheduleLayerFlushRequired() OVERRIDE { scheduleLayerFlush(); }; >+ virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect) OVERRIDE; >+ virtual void commitCoordinatedGraphicsState(WebCore::CoordinatedGraphicsState&) OVERRIDE; > > #if ENABLE(CSS_SHADERS) >- void prepareCustomFilterProxiesIfNeeded(WebCore::CoordinatedGraphicsLayerState&); >+ virtual void prepareCustomFilterProxiesIfNeeded(WebCore::CoordinatedGraphicsLayerState&) OVERRIDE; > > // WebCustomFilterProgramProxyClient > void removeCustomFilterProgramProxy(WebCustomFilterProgramProxy*); >@@ -164,41 +115,20 @@ private: > void disconnectCustomFilterPrograms(); > #endif > >- OwnPtr<WebCore::GraphicsLayer> m_rootLayer; >- >- // The layer which contains all non-composited content. >- OwnPtr<WebCore::GraphicsLayer> m_nonCompositedContentLayer; >- > // The page overlay layer. Will be null if there's no page overlay. > OwnPtr<WebCore::GraphicsLayer> m_pageOverlayLayer; > >- 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; > > 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; >diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h >index 39fef824fa294a5b5fe6a13a15675935fe735ac9..1c56ae5555d3aa06739c9c76d7efc6f6118bac5d 100644 >--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h >+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h >@@ -85,9 +85,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