WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Remove CCLayerTreeHostImplClient as it was unused. Pass visibility via commit. Fix compile with THREADED_COMPOSITING. Nit fixes.
bug-66807-20110829144807.patch (text/plain), 117.21 KB, created by
Nat Duca
on 2011-08-29 14:48:08 PDT
(
hide
)
Description:
Remove CCLayerTreeHostImplClient as it was unused. Pass visibility via commit. Fix compile with THREADED_COMPOSITING. Nit fixes.
Filename:
MIME Type:
Creator:
Nat Duca
Created:
2011-08-29 14:48:08 PDT
Size:
117.21 KB
patch
obsolete
>Subversion Revision: 93979 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b2ad0200fc4f5ebc40412d6c918398866a3a4dbc..a8b2f1f5a572ed2e7429e4e56df05bebe4224813 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,166 @@ >+2011-08-26 Nat Duca <nduca@chromium.org> >+ >+ [chromium] Introduce CCLayerTreeHostImplMainThreadProxy in order to move LayerRenderer to CCLayerTreeHostImpl >+ https://bugs.webkit.org/show_bug.cgi?id=66807 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCore.gypi: >+ * platform/graphics/chromium/ContentLayerChromium.cpp: >+ (WebCore::ContentLayerChromium::createTextureUpdater): >+ * platform/graphics/chromium/ImageLayerChromium.cpp: >+ (WebCore::ImageLayerChromium::createTextureUpdater): >+ * platform/graphics/chromium/LayerChromium.cpp: >+ (WebCore::LayerChromium::setLayerRendererRecursive): >+ * platform/graphics/chromium/LayerChromium.h: >+ * platform/graphics/chromium/LayerRendererChromium.cpp: >+ (WebCore::LayerRendererChromium::create): >+ (WebCore::LayerRendererChromium::LayerRendererChromium): >+ (WebCore::LayerRendererChromium::initialize): >+ (WebCore::LayerRendererChromium::updateLayers): >+ (WebCore::LayerRendererChromium::drawLayers): >+ (WebCore::LayerRendererChromium::drawLayersInternal): >+ (WebCore::LayerRendererChromium::getOffscreenLayerTexture): >+ (WebCore::LayerRendererChromium::isContextLost): >+ * platform/graphics/chromium/LayerRendererChromium.h: >+ (WebCore::LayerRendererChromium::capabilities): >+ (WebCore::LayerRendererChromium::rootLayerImpl): >+ (WebCore::LayerRendererChromium::contextSupportsMapSub): >+ (WebCore::LayerRendererChromium::viewportSize): >+ * platform/graphics/chromium/TiledLayerChromium.cpp: >+ (WebCore::TiledLayerChromium::setLayerTreeHost): >+ * platform/graphics/chromium/VideoLayerChromium.cpp: >+ (WebCore::VideoLayerChromium::reserveTextures): >+ * platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp: >+ (WebCore::CCCanvasLayerImpl::draw): >+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: >+ (WebCore::CCLayerTreeHost::CCLayerTreeHost): >+ (WebCore::CCLayerTreeHost::initialize): >+ (WebCore::CCLayerTreeHost::~CCLayerTreeHost): >+ (WebCore::CCLayerTreeHost::animateAndLayout): >+ (WebCore::CCLayerTreeHost::commitTo): >+ (WebCore::CCLayerTreeHost::createCompositorThread): >+ (WebCore::CCLayerTreeHost::createLayerTreeHostContext3D): >+ (WebCore::CCLayerTreeHost::createLayerTreeHostImpl): >+ (WebCore::CCLayerTreeHost::didRecreateGraphicsContext): >+ (WebCore::CCLayerTreeHost::scheduleComposite): >+ (WebCore::CCLayerTreeHost::context): >+ (WebCore::CCLayerTreeHost::compositeAndReadback): >+ (WebCore::CCLayerTreeHost::finishAllRendering): >+ (WebCore::CCLayerTreeHost::layerRendererCapabilities): >+ (WebCore::CCLayerTreeHost::setRootLayer): >+ (WebCore::CCLayerTreeHost::skiaContext): >+ (WebCore::CCLayerTreeHost::setViewport): >+ (WebCore::CCLayerTreeHost::setVisible): >+ (WebCore::CCLayerTreeHost::loseCompositorContext): >+ (WebCore::CCLayerTreeHost::contentsTextureManager): >+ (WebCore::CCLayerTreeHost::composite): >+ * platform/graphics/chromium/cc/CCLayerTreeHost.h: >+ (WebCore::CCSettings::CCSettings): >+ (WebCore::LayerRendererCapabilities::LayerRendererCapabilities): >+ * platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h: Removed. >+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: >+ (WebCore::CCLayerTreeHostImpl::create): >+ (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl): >+ (WebCore::CCLayerTreeHostImpl::commitComplete): >+ (WebCore::CCLayerTreeHostImpl::context): >+ (WebCore::CCLayerTreeHostImpl::drawLayers): >+ (WebCore::CCLayerTreeHostImpl::finishAllRendering): >+ (WebCore::CCLayerTreeHostImpl::isContextLost): >+ (WebCore::CCLayerTreeHostImpl::layerRendererCapabilities): >+ (WebCore::CCLayerTreeHostImpl::present): >+ (WebCore::CCLayerTreeHostImpl::readback): >+ (WebCore::CCLayerTreeHostImpl::setRootLayer): >+ (WebCore::CCLayerTreeHostImpl::setVisible): >+ (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer): >+ (WebCore::CCLayerTreeHostImpl::updateLayers): >+ (WebCore::CCLayerTreeHostImpl::setViewport): >+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: >+ (WebCore::CCLayerTreeHostImpl::layerRenderer): >+ (WebCore::CCLayerTreeHostImpl::rootLayer): >+ (WebCore::CCLayerTreeHostImpl::viewportSize): >+ * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp: Removed. >+ * platform/graphics/chromium/cc/CCMainThreadTask.h: >+ (WebCore::MainThreadTask4::create): >+ (WebCore::MainThreadTask4::MainThreadTask4): >+ (WebCore::MainThreadTask4::performTask): >+ (WebCore::MainThreadTask5::create): >+ (WebCore::MainThreadTask5::MainThreadTask5): >+ (WebCore::MainThreadTask5::performTask): >+ (WebCore::createMainThreadTask): >+ * platform/graphics/chromium/cc/CCPluginLayerImpl.cpp: >+ (WebCore::CCPluginLayerImpl::draw): >+ * platform/graphics/chromium/cc/CCProxy.cpp: Renamed from Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp. >+ (WebCore::CCProxy::isMainThread): >+ (WebCore::CCProxy::isImplThread): >+ (WebCore::CCProxy::setImplThread): >+ * platform/graphics/chromium/cc/CCProxy.h: Added. >+ (WebCore::CCProxy::~CCProxy): >+ (WebCore::CCProxy::CCProxy): >+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp: Added. >+ (WebCore::ScopedSetImplThread::ScopedSetImplThread): >+ (WebCore::ScopedSetImplThread::~ScopedSetImplThread): >+ (WebCore::CCSingleThreadProxy::create): >+ (WebCore::CCSingleThreadProxy::CCSingleThreadProxy): >+ (WebCore::CCSingleThreadProxy::start): >+ (WebCore::CCSingleThreadProxy::~CCSingleThreadProxy): >+ (WebCore::CCSingleThreadProxy::compositeAndReadback): >+ (WebCore::CCSingleThreadProxy::context): >+ (WebCore::CCSingleThreadProxy::finishAllRendering): >+ (WebCore::CCSingleThreadProxy::isStarted): >+ (WebCore::CCSingleThreadProxy::initializeLayerRenderer): >+ (WebCore::CCSingleThreadProxy::layerRendererCapabilities): >+ (WebCore::CCSingleThreadProxy::loseCompositorContext): >+ (WebCore::CCSingleThreadProxy::setNeedsCommitAndRedraw): >+ (WebCore::CCSingleThreadProxy::setNeedsRedraw): >+ (WebCore::CCSingleThreadProxy::setVisible): >+ (WebCore::CCSingleThreadProxy::stop): >+ (WebCore::CCSingleThreadProxy::skiaContext): >+ (WebCore::CCSingleThreadProxy::setNeedsRedrawOnImplThread): >+ (WebCore::CCSingleThreadProxy::contentsTextureManager): >+ (WebCore::CCSingleThreadProxy::compositeImmediately): >+ (WebCore::CCSingleThreadProxy::compositeIfNeeded): >+ (WebCore::CCSingleThreadProxy::doComposite): >+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h: Copied from Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h. >+ * platform/graphics/chromium/cc/CCThreadProxy.cpp: Added. >+ (WebCore::CCThreadProxy::create): >+ (WebCore::CCThreadProxy::CCThreadProxy): >+ (WebCore::CCThreadProxy::~CCThreadProxy): >+ (WebCore::CCThreadProxy::compositeAndReadback): >+ (WebCore::CCThreadProxy::context): >+ (WebCore::CCThreadProxy::finishAllRendering): >+ (WebCore::CCThreadProxy::isStarted): >+ (WebCore::CCThreadProxy::initializeLayerRenderer): >+ (WebCore::CCThreadProxy::layerRendererCapabilities): >+ (WebCore::CCThreadProxy::loseCompositorContext): >+ (WebCore::CCThreadProxy::setNeedsCommitAndRedraw): >+ (WebCore::CCThreadProxy::setNeedsRedraw): >+ (WebCore::CCThreadProxy::setVisible): >+ (WebCore::CCThreadProxy::start): >+ (WebCore::CCThreadProxy::stop): >+ (WebCore::CCThreadProxy::skiaContext): >+ (WebCore::CCThreadProxy::contentsTextureManager): >+ (WebCore::CCThreadProxy::beginFrameAndCommitOnCCThread): >+ (WebCore::CCThreadProxy::beginFrameAndCommit): >+ (WebCore::CCThreadProxy::commitOnCCThread): >+ (WebCore::CCThreadProxy::drawLayersOnCCThread): >+ (WebCore::CCThreadProxy::setNeedsCommitAndRedrawOnCCThread): >+ (WebCore::CCThreadProxy::setNeedsRedrawOnCCThread): >+ (WebCore::CCThreadProxy::setVisibleOnCCThread): >+ (WebCore::CCThreadProxy::initializeImplOnCCThread): >+ (WebCore::CCThreadProxy::initializeLayerRendererOnCCThread): >+ (WebCore::CCThreadProxy::layerTreeHostClosedOnCCThread): >+ * platform/graphics/chromium/cc/CCThreadProxy.h: Renamed from Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h. >+ (WebCore::CCThreadProxy::setNeedsRedrawOnImplThread): >+ * platform/graphics/chromium/cc/CCThreadTask.h: >+ (WebCore::CCThreadTask5::create): >+ (WebCore::CCThreadTask5::CCThreadTask5): >+ (WebCore::CCThreadTask5::performTask): >+ (WebCore::createCCThreadTask): >+ * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: >+ * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp: >+ (WebCore::CCVideoLayerImpl::draw): >+ > 2011-08-29 Alexander Pavlov <apavlov@chromium.org> > > Web Inspector: <button hidden>..</button> has a different computed "display" value than "none" >diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi >index c06ce4b632eb52e2eb614531bb6fb8f503678650..cdcf59ee9714e62c92195cebbedf299ba95af944 100644 >--- a/Source/WebCore/WebCore.gypi >+++ b/Source/WebCore/WebCore.gypi >@@ -3535,20 +3535,22 @@ > 'platform/graphics/chromium/cc/CCLayerTilingData.h', > 'platform/graphics/chromium/cc/CCLayerTreeHost.cpp', > 'platform/graphics/chromium/cc/CCLayerTreeHost.h', >- 'platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp', >- 'platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h', > 'platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp', > 'platform/graphics/chromium/cc/CCLayerTreeHostImpl.h', >- 'platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp', >- 'platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h', > 'platform/graphics/chromium/cc/CCMainThread.cpp', > 'platform/graphics/chromium/cc/CCMainThread.h', > 'platform/graphics/chromium/cc/CCMainThreadTask.h', > 'platform/graphics/chromium/cc/CCPluginLayerImpl.cpp', > 'platform/graphics/chromium/cc/CCPluginLayerImpl.h', >+ 'platform/graphics/chromium/cc/CCProxy.h', >+ 'platform/graphics/chromium/cc/CCProxy.cpp', >+ 'platform/graphics/chromium/cc/CCSingleThreadProxy.h', >+ 'platform/graphics/chromium/cc/CCSingleThreadProxy.cpp', > 'platform/graphics/chromium/cc/CCRenderSurface.cpp', > 'platform/graphics/chromium/cc/CCRenderSurface.h', > 'platform/graphics/chromium/cc/CCThread.h', >+ 'platform/graphics/chromium/cc/CCThreadProxy.h', >+ 'platform/graphics/chromium/cc/CCThreadProxy.cpp', > 'platform/graphics/chromium/cc/CCThreadTask.h', > 'platform/graphics/chromium/cc/CCTiledLayerImpl.cpp', > 'platform/graphics/chromium/cc/CCTiledLayerImpl.h', >diff --git a/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp >index 59c2cca1d92cd3aef63a4701e05bd1fbaacb84e7..db5e0346f6b752cfccb5b4e4c6953e5b7d490b21 100644 >--- a/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp >@@ -120,16 +120,18 @@ bool ContentLayerChromium::drawsContent() const > > void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host) > { >-#if !USE(THREADED_COMPOSITING) > #if USE(SKIA) >+ // Note that host->skiaContext() will crash if called while in threaded >+ // mode. This thus depends on CCLayerTreeHost::initialize turning off >+ // acceleratePainting to prevent this from crashing. > if (host->settings().acceleratePainting) { >- m_textureUpdater = LayerTextureUpdaterSkPicture::create(ContentLayerPainter::create(m_owner), host->layerRenderer()->skiaContext()); >+ GrContext* context = const_cast<CCLayerTreeHost*>(host)->skiaContext(); >+ m_textureUpdater = LayerTextureUpdaterSkPicture::create(ContentLayerPainter::create(m_owner), context); > return; > } > #endif // SKIA >-#endif // !THREADED_COMPOSITING > >- m_textureUpdater = LayerTextureUpdaterBitmap::create(ContentLayerPainter::create(m_owner), host->contextSupportsMapSub()); >+ m_textureUpdater = LayerTextureUpdaterBitmap::create(ContentLayerPainter::create(m_owner), host->layerRendererCapabilities().usingMapSub); > } > > } >diff --git a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp >index 23c8555f50be16e8f8bf3191f8ec57819d2cc5bc..71bc0b6b9db656bc460f4f8565494fa57ab50b8d 100644 >--- a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp >@@ -181,7 +181,7 @@ bool ImageLayerChromium::drawsContent() const > > void ImageLayerChromium::createTextureUpdater(const CCLayerTreeHost* host) > { >- m_textureUpdater = ImageLayerTextureUpdater::create(host->contextSupportsMapSub()); >+ m_textureUpdater = ImageLayerTextureUpdater::create(host->layerRendererCapabilities().usingMapSub); > } > > } >diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp >index 9563eaa57f5673c8599d4dbaac88b92d9c494348..eeeabb210aa1b32589c671b8c371114492b03310 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp >@@ -96,6 +96,19 @@ void LayerChromium::cleanupResources() > { > } > >+void LayerChromium::setLayerRendererRecursive(LayerRendererChromium* renderer) >+{ >+ for (size_t i = 0; i < children().size(); ++i) >+ children()[i]->setLayerRendererRecursive(renderer); >+ >+ if (maskLayer()) >+ maskLayer()->setLayerRendererRecursive(renderer); >+ if (replicaLayer()) >+ replicaLayer()->setLayerRendererRecursive(renderer); >+ >+ setLayerRenderer(renderer); >+} >+ > void LayerChromium::setLayerRenderer(LayerRendererChromium* renderer) > { > // If we're changing layer renderers then we need to free up any resources >diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.h b/Source/WebCore/platform/graphics/chromium/LayerChromium.h >index 58ed1b04096dac3e1bf6e7796af5906b8388cc85..fe2e4c71373be525d58c63b7ce0a81ea8e1e5c87 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.h >+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.h >@@ -153,6 +153,8 @@ public: > void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; } > bool isRootLayer() const { return m_isRootLayer; } > >+ void setLayerRendererRecursive(LayerRendererChromium*); >+ > // Derived types must override this method if they need to react to a change > // in the LayerRendererChromium. > // FIXME, replace with CCLayerTreeHost. >diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >index 70a05dca09010a6cb59fcf5b1dae3102d8f6ddfd..0b2cf373578bd71911678cad9dd704dcb74f28fd 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp >@@ -45,6 +45,7 @@ > #include "LayerTextureUpdaterCanvas.h" > #include "NonCompositedContentHost.h" > #include "NotImplemented.h" >+#include "PlatformColor.h" > #include "RenderSurfaceChromium.h" > #include "TextStream.h" > #include "TextureManager.h" >@@ -449,13 +450,13 @@ bool contextSupportsAcceleratedPainting(GraphicsContext3D* context) > } > #endif > >-PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHost* owner, PassRefPtr<GraphicsContext3D> context) >+PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHost* owner, CCLayerTreeHostImpl* ownerImpl, PassRefPtr<GraphicsContext3D> context) > { > #if USE(SKIA) > if (owner->settings().acceleratePainting && !contextSupportsAcceleratedPainting(context.get())) > return 0; > #endif >- RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(owner, context))); >+ RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(owner, ownerImpl, context))); > if (!layerRenderer->initialize()) > return 0; > >@@ -463,8 +464,10 @@ PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHost* > } > > LayerRendererChromium::LayerRendererChromium(CCLayerTreeHost* owner, >+ CCLayerTreeHostImpl* ownerImpl, > PassRefPtr<GraphicsContext3D> context) > : m_owner(owner) >+ , m_ownerImpl(ownerImpl) > , m_currentRenderSurface(0) > , m_offscreenFramebufferId(0) > , m_context(context) >@@ -483,14 +486,18 @@ bool LayerRendererChromium::initialize() > // Limit the bytes allocated toward textures in the bitmap->texture cache. > static const size_t maxTextureCacheBytes = 50 * 1024 * 1024; > m_skiaContext->setTextureCacheLimits(maxTextureCacheCount, maxTextureCacheBytes); >+ m_capabilities.usingAcceleratedPainting = true; > } > #endif > > WebCore::Extensions3D* extensions = m_context->getExtensions(); >- m_contextSupportsMapSub = extensions->supports("GL_CHROMIUM_map_sub"); >- if (m_contextSupportsMapSub) >+ m_capabilities.usingMapSub = extensions->supports("GL_CHROMIUM_map_sub"); >+ if (m_capabilities.usingMapSub) > extensions->ensureEnabled("GL_CHROMIUM_map_sub"); > >+ m_capabilities.maxTextureSize = maxTextureSize(); >+ m_capabilities.bestTextureFormat = PlatformColor::bestTextureFormat(m_context.get()); >+ > if (!initializeSharedObjects()) > return false; > >@@ -514,11 +521,10 @@ void LayerRendererChromium::clearRenderSurfacesOnCCLayerImplRecursive(CCLayerImp > layer->clearRenderSurface(); > } > >-void LayerRendererChromium::clearRootCCLayerImpl() >+void LayerRendererChromium::close() > { >- if (m_rootCCLayerImpl) >- clearRenderSurfacesOnCCLayerImplRecursive(m_rootCCLayerImpl.get()); >- m_rootCCLayerImpl.clear(); >+ if (rootLayerImpl()) >+ clearRenderSurfacesOnCCLayerImplRecursive(rootLayerImpl()); > } > > GraphicsContext3D* LayerRendererChromium::context() >@@ -559,6 +565,9 @@ void LayerRendererChromium::viewportChanged() > > void LayerRendererChromium::updateLayers() > { >+ if (!rootLayerImpl()) >+ return; >+ > if (m_owner->viewportSize().isEmpty()) > return; > >@@ -567,13 +576,6 @@ void LayerRendererChromium::updateLayers() > // RenderWidget. > m_headsUpDisplay->onFrameBegin(currentTime()); > >- // Recheck that we still have a root layer. This may become null if >- // compositing gets turned off during a paint operation. >- if (!rootLayer()) { >- m_rootCCLayerImpl.clear(); >- return; >- } >- > updateLayers(rootLayer()->platformLayer()); > } > >@@ -582,12 +584,6 @@ void LayerRendererChromium::drawLayers() > if (!rootLayer()) > return; > >- { >- TRACE_EVENT("LayerRendererChromium::synchronizeTrees", this, 0); >- m_rootCCLayerImpl = TreeSynchronizer::synchronizeTrees(rootLayer()->platformLayer(), m_rootCCLayerImpl.get()); >- } >- >- > m_renderSurfaceTextureManager->setMemoryLimitBytes(textureMemoryHighLimitBytes - m_contentsTextureManager->currentMemoryUseBytes()); > drawLayersInternal(); > >@@ -732,7 +728,7 @@ void LayerRendererChromium::drawLayersInternal() > return; > > TRACE_EVENT("LayerRendererChromium::drawLayers", this, 0); >- CCLayerImpl* rootDrawLayer = m_rootCCLayerImpl.get(); >+ CCLayerImpl* rootDrawLayer = rootLayerImpl(); > makeContextCurrent(); > > if (!rootDrawLayer->renderSurface()) >@@ -840,20 +836,6 @@ void LayerRendererChromium::present() > m_headsUpDisplay->onPresent(); > } > >-void LayerRendererChromium::setLayerRendererRecursive(LayerChromium* layer) >-{ >- const Vector<RefPtr<LayerChromium> >& children = layer->children(); >- for (size_t i = 0; i < children.size(); ++i) >- setLayerRendererRecursive(children[i].get()); >- >- if (layer->maskLayer()) >- setLayerRendererRecursive(layer->maskLayer()); >- if (layer->replicaLayer()) >- setLayerRendererRecursive(layer->replicaLayer()); >- >- layer->setLayerRenderer(this); >-} >- > void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect) > { > ASSERT(rect.maxX() <= viewportWidth() && rect.maxY() <= viewportHeight()); >@@ -948,7 +930,7 @@ void LayerRendererChromium::updateCompositorResources(LayerChromium* layer) > > ManagedTexture* LayerRendererChromium::getOffscreenLayerTexture() > { >- return settings().compositeOffscreen && m_rootCCLayerImpl ? m_rootCCLayerImpl->renderSurface()->contentsTexture() : 0; >+ return settings().compositeOffscreen && rootLayerImpl() ? rootLayerImpl()->renderSurface()->contentsTexture() : 0; > } > > void LayerRendererChromium::copyOffscreenTextureToDisplay() >@@ -1299,7 +1281,7 @@ void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const > dumpRenderSurfaces(ts, indent, layer->children()[i].get()); > } > >-bool LayerRendererChromium::isCompositorContextLost() >+bool LayerRendererChromium::isContextLost() > { > return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR); > } >diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h >index 2d80403dd526bceec84b3e9ca4c809261ac175fd..c2c72bde1b3122f14fedde54a7926126300f247c 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h >+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h >@@ -42,6 +42,7 @@ > #include "cc/CCHeadsUpDisplay.h" > #include "cc/CCLayerSorter.h" > #include "cc/CCLayerTreeHost.h" >+#include "cc/CCLayerTreeHostImpl.h" > #include "cc/CCPluginLayerImpl.h" > #include "cc/CCVideoLayerImpl.h" > #include <wtf/HashMap.h> >@@ -63,7 +64,7 @@ namespace WebCore { > > class CCHeadsUpDisplay; > class CCLayerImpl; >-class CCLayerTreeHostCommitter; >+class CCLayerTreeHost; // TODO: remove pointers to this > class CCLayerTreeHostImpl; > class GeometryBinding; > class GraphicsContext3D; >@@ -72,11 +73,15 @@ class NonCompositedContentHost; > // Class that handles drawing of composited render layers using GL. > class LayerRendererChromium : public RefCounted<LayerRendererChromium> { > public: >- static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHost*, PassRefPtr<GraphicsContext3D>); >+ static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHost*, CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>); >+ >+ // Must be called in order to allow the LayerRendererChromium to destruct >+ void close(); > > virtual ~LayerRendererChromium(); > > const CCSettings& settings() const { return m_owner->settings(); } >+ const LayerRendererCapabilities& capabilities() const { return m_capabilities; } > > CCLayerTreeHost* owner() { return m_owner; } > const CCLayerTreeHost* owner() const { return m_owner; } >@@ -84,14 +89,17 @@ public: > GraphicsLayer* rootLayer() { return m_owner->rootLayer(); } > const GraphicsLayer* rootLayer() const { return m_owner->rootLayer(); } > >+ CCLayerImpl* rootLayerImpl() { return m_ownerImpl->rootLayer(); } >+ const CCLayerImpl* rootLayerImpl() const { return m_ownerImpl->rootLayer(); } >+ > GraphicsContext3D* context(); >- bool contextSupportsMapSub() const { return m_contextSupportsMapSub; } >+ bool contextSupportsMapSub() const { return m_capabilities.usingMapSub; } > > #if USE(SKIA) > GrContext* skiaContext() { return m_skiaContext.get(); } > #endif > >- const IntSize& viewportSize() { return m_owner->viewportSize(); } >+ const IntSize& viewportSize() { return m_ownerImpl->viewportSize(); } > int viewportWidth() { return viewportSize().width(); } > int viewportHeight() { return viewportSize().height(); } > >@@ -142,24 +150,17 @@ public: > > String layerTreeAsText() const; > >- // Return true if the compositor context has an error. >- bool isCompositorContextLost(); >+ bool isContextLost(); > > void releaseTextures(); > >- void setLayerRendererRecursive(LayerChromium*); >- > GC3Denum bestTextureFormat(); > > typedef Vector<RefPtr<LayerChromium> > LayerList; > typedef Vector<RefPtr<CCLayerImpl> > CCLayerList; > >- void clearRootCCLayerImpl(); > private: >- // FIXME: This needs to be moved to the CCLayerTreeHostImpl when that class exists. >- RefPtr<CCLayerImpl> m_rootCCLayerImpl; >- >- LayerRendererChromium(CCLayerTreeHost*, PassRefPtr<GraphicsContext3D>); >+ LayerRendererChromium(CCLayerTreeHost*, CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>); > bool initialize(); > > void updateLayers(LayerChromium*); >@@ -192,9 +193,13 @@ private: > > void clearRenderSurfacesOnCCLayerImplRecursive(CCLayerImpl*); > >- // FIXME: Change this to CCLayerTreeHostImpl >+ // FIXME: Remove CCLayerTreeHost field > CCLayerTreeHost* m_owner; > >+ CCLayerTreeHostImpl* m_ownerImpl; >+ >+ LayerRendererCapabilities m_capabilities; >+ > TransformationMatrix m_projectionMatrix; > TransformationMatrix m_windowMatrix; > >@@ -234,8 +239,6 @@ private: > OwnPtr<GrContext> m_skiaContext; > #endif > >- bool m_contextSupportsMapSub; >- > CCRenderSurface* m_defaultRenderSurface; > > CCLayerSorter m_layerSorter; >diff --git a/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h b/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h >index 26ce8b5d9197ba36869429e6b0c1f46c48b0aa56..c6ea7bc1ec3fe8799ef19a71a1380f4b2d43a027 100644 >--- a/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h >+++ b/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h >@@ -80,7 +80,6 @@ private: > LayerTextureSubImage m_texSubImage; > }; > >-#if !USE(THREADED_COMPOSITING) > #if USE(SKIA) > class LayerTextureUpdaterSkPicture : public LayerTextureUpdaterCanvas { > WTF_MAKE_NONCOPYABLE(LayerTextureUpdaterSkPicture); >@@ -110,7 +109,6 @@ private: > OwnPtr<SkCanvas> m_canvas; // GPU accelerated canvas. > }; > #endif // SKIA >-#endif // !THREADED_COMPOSITING > > } // namespace WebCore > #endif // USE(ACCELERATED_COMPOSITING) >diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp >index 3e102ec865695f83bb7081e3bff6191bbad9e2c3..a79ea12c4d74c191ec4d607ebfd48ad5e37df83a 100644 >--- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp >@@ -141,7 +141,7 @@ void TiledLayerChromium::setLayerTreeHost(CCLayerTreeHost* host) > > createTextureUpdater(host); > >- m_textureFormat = host->bestTextureFormat(); >+ m_textureFormat = host->layerRendererCapabilities().bestTextureFormat; > m_textureOrientation = textureUpdater()->orientation(); > m_sampledTexelFormat = textureUpdater()->sampledTexelFormat(m_textureFormat); > m_tiler = CCLayerTilingData::create( >diff --git a/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp >index 652d28dfb3c6236e703c193d4ee576e16998d1cf..16b50b172c062c22a9b519c3e0d0ce71870f77aa 100644 >--- a/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp >@@ -178,7 +178,7 @@ bool VideoLayerChromium::reserveTextures(const VideoFrameChromium* frame, GC3Den > ASSERT(frame); > ASSERT(textureFormat != GraphicsContext3D::INVALID_VALUE); > >- int maxTextureSize = m_layerTreeHost->maxTextureSize(); >+ int maxTextureSize = m_layerTreeHost->layerRendererCapabilities().maxTextureSize; > > for (unsigned plane = 0; plane < frame->planes(); plane++) { > IntSize requiredTextureSize = frame->requiredTextureSize(plane); >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp >index a866a179a709955edcf58c80d71294eea0259274..0e757248746ff6e24f31ed0917fd7fd48a304889 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp >@@ -31,7 +31,7 @@ > > #include "GraphicsContext3D.h" > #include "LayerRendererChromium.h" >-#include "cc/CCLayerTreeHostImplProxy.h" >+#include "cc/CCProxy.h" > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -50,7 +50,7 @@ CCCanvasLayerImpl::~CCCanvasLayerImpl() > > void CCCanvasLayerImpl::draw() > { >- ASSERT(CCLayerTreeHostImplProxy::isImplThread()); >+ ASSERT(CCProxy::isImplThread()); > ASSERT(layerRenderer()); > const CCCanvasLayerImpl::Program* program = layerRenderer()->canvasLayerProgram(); > ASSERT(program && program->initialized()); >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp >index 5d6bc9c327352679e5864ac82be5bbf44ee52e6f..f59f45a9f4238cccaf7aff80c10625d034b9af46 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp >@@ -30,10 +30,12 @@ > #include "LayerPainterChromium.h" > #include "LayerRendererChromium.h" > #include "NonCompositedContentHost.h" >-#include "PlatformColor.h" > #include "TraceEvent.h" >-#include "cc/CCLayerTreeHostCommitter.h" >+#include "TreeSynchronizer.h" > #include "cc/CCLayerTreeHostImpl.h" >+#include "cc/CCSingleThreadProxy.h" >+#include "cc/CCThread.h" >+#include "cc/CCThreadProxy.h" > > namespace WebCore { > >@@ -46,28 +48,30 @@ PassRefPtr<CCLayerTreeHost> CCLayerTreeHost::create(CCLayerTreeHostClient* clien > } > > CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCSettings& settings) >- : m_recreatingGraphicsContext(false) >- , m_maxTextureSize(0) >- , m_contextSupportsMapSub(false) >- , m_animating(false) >+ : m_animating(false) > , m_client(client) > , m_frameNumber(0) > , m_nonCompositedContentHost(NonCompositedContentHost::create(m_client->createRootLayerPainter())) > , m_settings(settings) >+ , m_visible(true) > { > } > > bool CCLayerTreeHost::initialize() > { >- m_layerRenderer = createLayerRenderer(); >- if (!m_layerRenderer) >+ if (m_settings.enableCompositorThread) { >+ // Accelerated Painting is not supported in threaded mode. Turn it off. >+ m_settings.acceleratePainting = false; >+ m_proxy = CCThreadProxy::create(this); >+ } else >+ m_proxy = CCSingleThreadProxy::create(this); >+ m_proxy->start(); >+ >+ if (!m_proxy->initializeLayerRenderer(this)) > return false; > >- // FIXME: In the threaded case, these values will need to be initialized >- // by something other than m_layerRenderer. >- m_maxTextureSize = m_layerRenderer->maxTextureSize(); >- m_bestTextureFormat = PlatformColor::bestTextureFormat(m_layerRenderer->context()); >- m_contextSupportsMapSub = m_layerRenderer->contextSupportsMapSub(); >+ // Update m_settings based on capabilities that we got back from the renderer. >+ m_settings.acceleratePainting = m_proxy->layerRendererCapabilities().usingAcceleratedPainting; > > m_rootLayer = GraphicsLayer::create(0); > #ifndef NDEBUG >@@ -77,12 +81,8 @@ bool CCLayerTreeHost::initialize() > > m_rootLayer->addChild(m_nonCompositedContentHost->graphicsLayer()); > >- >-#if USE(THREADED_COMPOSITING) >- m_proxy = CCLayerTreeHostImplProxy::create(this); >- ASSERT(m_proxy->isStarted()); >+ // We changed the root layer. Tell the proxy a commit is needed. > m_proxy->setNeedsCommitAndRedraw(); >-#endif > > return true; > } >@@ -90,62 +90,80 @@ bool CCLayerTreeHost::initialize() > CCLayerTreeHost::~CCLayerTreeHost() > { > TRACE_EVENT("CCLayerTreeHost::~CCLayerTreeHost", this, 0); >-#if USE(THREADED_COMPOSITING) > m_proxy->stop(); > m_proxy.clear(); >-#endif > } > >-void CCLayerTreeHost::beginCommit() >+void CCLayerTreeHost::animateAndLayout(double frameBeginTime) >+{ >+ m_animating = true; >+ m_client->animateAndLayout(frameBeginTime); >+ m_animating = false; >+} >+ >+void CCLayerTreeHost::preCommit(CCLayerTreeHostImpl* hostImpl) > { >+ hostImpl->setVisible(m_visible); >+ hostImpl->setViewport(viewportSize()); > } > >-void CCLayerTreeHost::commitComplete() >+void CCLayerTreeHost::commitTo(CCLayerTreeHostImpl* hostImpl) > { >+ ASSERT(CCProxy::isImplThread()); >+ TRACE_EVENT("CCLayerTreeHost::commitTo", this, 0); >+ hostImpl->setSourceFrameNumber(frameNumber()); >+ >+ // Synchronize trees, if one exists at all... >+ if (rootLayer()) >+ hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer()->platformLayer(), hostImpl->rootLayer())); >+ else >+ hostImpl->setRootLayer(0); >+ > m_frameNumber++; > } > >-void CCLayerTreeHost::animateAndLayout(double frameBeginTime) >+PassOwnPtr<CCThread> CCLayerTreeHost::createCompositorThread() > { >- m_animating = true; >- m_client->animateAndLayout(frameBeginTime); >- m_animating = false; >+ return m_client->createCompositorThread(); > } > >-PassOwnPtr<CCLayerTreeHostCommitter> CCLayerTreeHost::createLayerTreeHostCommitter() >+PassRefPtr<GraphicsContext3D> CCLayerTreeHost::createLayerTreeHostContext3D() > { >- // FIXME: only called in threading case, fix when possible. >- return nullptr; >+ return m_client->createLayerTreeHostContext3D(); > } > >-PassOwnPtr<CCLayerTreeHostImpl> CCLayerTreeHost::createLayerTreeHostImpl(CCLayerTreeHostImplClient* client) >+PassOwnPtr<CCLayerTreeHostImpl> CCLayerTreeHost::createLayerTreeHostImpl() > { >- RefPtr<LayerRendererChromium> renderer(m_layerRenderer); >- return CCLayerTreeHostImpl::create(client, renderer); >+ return CCLayerTreeHostImpl::create(m_settings); > } > >-GraphicsContext3D* CCLayerTreeHost::context() >+void CCLayerTreeHost::didRecreateGraphicsContext(bool success) > { >- return m_layerRenderer->context(); >+ m_client->didRecreateGraphicsContext(success); > } > >-void CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) >+#if !USE(THREADED_COMPOSITING) >+void CCLayerTreeHost::scheduleComposite() > { >-#if USE(THREADED_COMPOSITING) >- // FIXME: need to implement this. >-#else >- composite(false); >- m_layerRenderer->getFramebufferPixels(pixels, rect); >+ m_client->scheduleComposite(); >+} > #endif >+ >+// Temporary hack until WebViewImpl context creation gets simplified >+GraphicsContext3D* CCLayerTreeHost::context() >+{ >+ ASSERT(!m_settings.enableCompositorThread); >+ return m_proxy->context(); >+} >+ >+bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) >+{ >+ return m_proxy->compositeAndReadback(pixels, rect); > } > > void CCLayerTreeHost::finishAllRendering() > { >-#if USE(THREADED_COMPOSITING) >- // FIXME: need to implement this. >-#else >- m_layerRenderer->finish(); >-#endif >+ m_proxy->finishAllRendering(); > } > > void CCLayerTreeHost::invalidateRootLayerRect(const IntRect& dirtyRect) >@@ -153,6 +171,11 @@ void CCLayerTreeHost::invalidateRootLayerRect(const IntRect& dirtyRect) > m_nonCompositedContentHost->invalidateRect(dirtyRect); > } > >+const LayerRendererCapabilities& CCLayerTreeHost::layerRendererCapabilities() const >+{ >+ return m_proxy->layerRendererCapabilities(); >+} >+ > void CCLayerTreeHost::setNeedsCommitAndRedraw() > { > #if USE(THREADED_COMPOSITING) >@@ -177,13 +200,17 @@ void CCLayerTreeHost::setRootLayer(GraphicsLayer* layer) > { > m_nonCompositedContentHost->graphicsLayer()->removeAllChildren(); > m_nonCompositedContentHost->invalidateEntireLayer(); >- if (layer) { >+ if (layer) > m_nonCompositedContentHost->graphicsLayer()->addChild(layer); >- layer->platformLayer()->setLayerRenderer(m_layerRenderer.get()); >- } else >- layerRenderer()->clearRootCCLayerImpl(); >+} > >+#if USE(SKIA) >+GrContext* CCLayerTreeHost::skiaContext() >+{ >+ ASSERT(m_settings.acceleratePainting); >+ return m_proxy->skiaContext(); > } >+#endif > > void CCLayerTreeHost::setViewport(const IntSize& viewportSize, const IntSize& contentsSize, const IntPoint& scrollPosition) > { >@@ -193,114 +220,33 @@ void CCLayerTreeHost::setViewport(const IntSize& viewportSize, const IntSize& co > m_nonCompositedContentHost->setScrollPosition(scrollPosition); > m_nonCompositedContentHost->graphicsLayer()->setSize(contentsSize); > >- if (visibleRectChanged) { >+ if (visibleRectChanged) > m_nonCompositedContentHost->invalidateEntireLayer(); >- if (m_layerRenderer) >- m_layerRenderer->viewportChanged(); >- } > > setNeedsCommitAndRedraw(); > } > > void CCLayerTreeHost::setVisible(bool visible) > { >-#if !USE(THREADED_COMPOSITING) >- if (!visible) >- m_layerRenderer->releaseTextures(); >-#endif >+ m_visible = visible; >+ m_proxy->setNeedsCommitAndRedraw(); > } > >-PassRefPtr<LayerRendererChromium> CCLayerTreeHost::createLayerRenderer() >+void CCLayerTreeHost::loseCompositorContext() > { >- // GraphicsContext3D::create might fail and return 0, in that case fall back to software. >- RefPtr<GraphicsContext3D> context = m_client->createLayerTreeHostContext3D(); >- if (!context) >- return 0; >- >- // Actually create the renderer. >- RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(this, context); >- >- // If creation failed, and we had asked for accelerated painting, disable accelerated painting >- // and try creating the renderer again. >- if (m_settings.acceleratePainting && !layerRenderer) { >- m_settings.acceleratePainting = false; >- layerRenderer = LayerRendererChromium::create(this, context); >- } >- >- return layerRenderer; >+ m_proxy->loseCompositorContext(); > } > > TextureManager* CCLayerTreeHost::contentsTextureManager() const > { >- // FIXME: this class should own the contents texture manager >- if (!m_layerRenderer) >- return 0; >- return m_layerRenderer->contentsTextureManager(); >+ return m_proxy->contentsTextureManager(); > } > > #if !USE(THREADED_COMPOSITING) >-void CCLayerTreeHost::doComposite() >+void CCLayerTreeHost::composite(bool) > { >-#ifndef NDEBUG >- CCLayerTreeHostImplProxy::setImplThread(true); >-#endif >- ASSERT(m_layerRenderer); >- m_layerRenderer->updateLayers(); >- m_layerRenderer->drawLayers(); >-#ifndef NDEBUG >- CCLayerTreeHostImplProxy::setImplThread(false); >-#endif >-} >- >-void CCLayerTreeHost::composite(bool finish) >-{ >- TRACE_EVENT("CCLayerTreeHost::composite", this, 0); >- >- if (m_recreatingGraphicsContext) { >- // reallocateRenderer will request a repaint whether or not it succeeded >- // in creating a new context. >- reallocateRenderer(); >- m_recreatingGraphicsContext = false; >- return; >- } >- >- // Do not composite if the compositor context is already lost. >- if (!m_layerRenderer->isCompositorContextLost()) { >- doComposite(); >- >- // Put result onscreen. >- m_layerRenderer->present(); >- } >- >- if (m_layerRenderer->isCompositorContextLost()) { >- // Trying to recover the context right here will not work if GPU process >- // died. This is because GpuChannelHost::OnErrorMessage will only be >- // called at the next iteration of the message loop, reverting our >- // recovery attempts here. Instead, we detach the root layer from the >- // renderer, recreate the renderer at the next message loop iteration >- // and request a repaint yet again. >- m_recreatingGraphicsContext = true; >- setNeedsCommitAndRedraw(); >- } >-} >- >-void CCLayerTreeHost::loseCompositorContext() >-{ >- m_recreatingGraphicsContext = true; >-} >- >-void CCLayerTreeHost::reallocateRenderer() >-{ >- RefPtr<LayerRendererChromium> layerRenderer = createLayerRenderer(); >- if (!layerRenderer) { >- m_client->didRecreateGraphicsContext(false); >- return; >- } >- >- layerRenderer->setLayerRendererRecursive(m_rootLayer->platformLayer()); >- m_layerRenderer = layerRenderer; >- >- m_client->didRecreateGraphicsContext(true); >+ ASSERT(!m_settings.enableCompositorThread); >+ static_cast<CCSingleThreadProxy*>(m_proxy.get())->compositeImmediately(); > } > #endif // !USE(THREADED_COMPOSITING) > >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h >index 99b8bf2094d83641483b49d93c690fb1eabae8c6..ebb657fa48725156f0995437edea5a4081b764df 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h >@@ -27,17 +27,19 @@ > > #include "GraphicsTypes3D.h" > #include "IntRect.h" >-#include "cc/CCLayerTreeHostCommitter.h" >-#include "cc/CCLayerTreeHostImplProxy.h" >+#include "cc/CCProxy.h" > > #include <wtf/PassOwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > >+#if USE(SKIA) >+class GrContext; >+#endif >+ > namespace WebCore { > > class CCLayerTreeHostImpl; >-class CCLayerTreeHostImplClient; > class CCThread; > class GraphicsContext3D; > class LayerChromium; >@@ -65,35 +67,64 @@ struct CCSettings { > CCSettings() > : acceleratePainting(false) > , compositeOffscreen(false) >+ , enableCompositorThread(false) > , showFPSCounter(false) > , showPlatformLayerTree(false) { } > > bool acceleratePainting; > bool compositeOffscreen; >+ bool enableCompositorThread; > bool showFPSCounter; > bool showPlatformLayerTree; > }; > >+// Provides information on an Impl's rendering capabilities back to the CCLayerTreeHost >+struct LayerRendererCapabilities { >+ LayerRendererCapabilities() >+ : bestTextureFormat(0) >+ , usingMapSub(false) >+ , usingAcceleratedPainting(false) >+ , maxTextureSize(0) { } >+ >+ GC3Denum bestTextureFormat; >+ bool usingMapSub; >+ bool usingAcceleratedPainting; >+ int maxTextureSize; >+}; >+ > class CCLayerTreeHost : public RefCounted<CCLayerTreeHost> { > public: > static PassRefPtr<CCLayerTreeHost> create(CCLayerTreeHostClient*, const CCSettings&); > virtual ~CCLayerTreeHost(); > >- virtual void animateAndLayout(double frameBeginTime); >- virtual void beginCommit(); >- virtual void commitComplete(); >- >- virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeHostImplClient*); >- virtual PassOwnPtr<CCLayerTreeHostCommitter> createLayerTreeHostCommitter(); >+ // CCLayerTreeHost interface to CCProxy. >+ void animateAndLayout(double frameBeginTime); >+ void preCommit(CCLayerTreeHostImpl*); // Temporary hack until CCLayerTreeHostImpl::updateLayers is split apart. >+ void commitTo(CCLayerTreeHostImpl*); >+ PassOwnPtr<CCThread> createCompositorThread(); >+ PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D(); >+ PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(); >+ void didRecreateGraphicsContext(bool success); >+#if !USE(THREADED_COMPOSITING) >+ void scheduleComposite(); >+#endif > >+ // CCLayerTreeHost interface to WebView. > bool animating() const { return m_animating; } > void setAnimating(bool animating) { m_animating = animating; } // Can be removed when non-threaded scheduling moves inside. > > CCLayerTreeHostClient* client() { return m_client; } > >+#if !USE(THREADED_COMPOSITING) >+ void composite(bool finish); >+#endif >+ > GraphicsContext3D* context(); > >- void compositeAndReadback(void *pixels, const IntRect&); >+ // Composites and attempts to read back the result into the provided >+ // buffer. If it wasn't possible, e.g. due to context lost, will return >+ // false. >+ bool compositeAndReadback(void *pixels, const IntRect&); > > void finishAllRendering(); > >@@ -101,6 +132,9 @@ public: > > void invalidateRootLayerRect(const IntRect& dirtyRect); > >+ const LayerRendererCapabilities& layerRendererCapabilities() const; >+ void loseCompositorContext(); >+ > void setNeedsCommitAndRedraw(); > void setNeedsRedraw(); > >@@ -110,6 +144,12 @@ public: > > const CCSettings& settings() const { return m_settings; } > >+ // Horrible ugly hack to allow main threaded code to get to the GrContext >+ // for accelerated painting. Remove this ASAP. >+#if USE(SKIA) >+ GrContext* skiaContext(); >+#endif >+ > void setViewport(const IntSize& viewportSize, const IntSize& contentsSize, const IntPoint& scrollPosition); > > const IntSize& viewportSize() const { return m_viewportSize; } >@@ -117,21 +157,8 @@ public: > > void setVisible(bool); > >- // Temporary home for the non-threaded rendering path. >-#if !USE(THREADED_COMPOSITING) >- void composite(bool finish); >- >- void loseCompositorContext(); >- >- LayerRendererChromium* layerRenderer() const { return m_layerRenderer.get(); } >-#endif >- > NonCompositedContentHost* nonCompositedContentHost() const { return m_nonCompositedContentHost.get(); } > >- bool contextSupportsMapSub() const { return m_contextSupportsMapSub; } >- int maxTextureSize() const { return m_maxTextureSize; } >- GC3Denum bestTextureFormat() { return m_bestTextureFormat; } >- > protected: > CCLayerTreeHost(CCLayerTreeHostClient*, const CCSettings&); > >@@ -140,26 +167,13 @@ private: > > PassRefPtr<LayerRendererChromium> createLayerRenderer(); > >- // Temporary home for the non-threaded rendering path. >-#if !USE(THREADED_COMPOSITING) >- void doComposite(); >- void reallocateRenderer(); >- >- bool m_recreatingGraphicsContext; >- RefPtr<LayerRendererChromium> m_layerRenderer; >-#endif >- >- int m_maxTextureSize; >- GC3Denum m_bestTextureFormat; >- bool m_contextSupportsMapSub; >- > bool m_animating; > > CCLayerTreeHostClient* m_client; > > int m_frameNumber; > >- OwnPtr<CCLayerTreeHostImplProxy> m_proxy; >+ OwnPtr<CCProxy> m_proxy; > > OwnPtr<GraphicsLayer> m_rootLayer; > OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost; >@@ -167,6 +181,7 @@ private: > CCSettings m_settings; > > IntSize m_viewportSize; >+ bool m_visible; > }; > > } >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp >deleted file mode 100644 >index 72dd714be7e384c8ef9e10924ff5cd2058699bea..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp >+++ /dev/null >@@ -1,44 +0,0 @@ >-/* >- * Copyright (C) 2011 Google 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" >- >-#include "cc/CCLayerTreeHostCommitter.h" >- >-#include "cc/CCLayerTreeHost.h" >-#include "cc/CCLayerTreeHostImpl.h" >- >-namespace WebCore { >- >-PassOwnPtr<CCLayerTreeHostCommitter> CCLayerTreeHostCommitter::create() >-{ >- return adoptPtr(new CCLayerTreeHostCommitter()); >-} >- >-void CCLayerTreeHostCommitter::commit(CCLayerTreeHost* host, CCLayerTreeHostImpl* hostImpl) >-{ >- hostImpl->setSourceFrameNumber(host->frameNumber()); >-} >- >-} >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h >deleted file mode 100644 >index bc318a4a714232d3184d2fed4ad809517583cc99..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h >+++ /dev/null >@@ -1,51 +0,0 @@ >-/* >- * Copyright (C) 2011 Google 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 CCLayerTreeHostCommitter_h >-#define CCLayerTreeHostCommitter_h >- >-#include <wtf/Noncopyable.h> >-#include <wtf/PassOwnPtr.h> >- >-namespace WebCore { >- >-class CCLayerTreeHost; >-class CCLayerTreeHostImpl; >- >-// FIXME: merge in TreeSynchronizer code into here >-class CCLayerTreeHostCommitter { >- WTF_MAKE_NONCOPYABLE(CCLayerTreeHostCommitter); >-public: >- static PassOwnPtr<CCLayerTreeHostCommitter> create(); >- virtual ~CCLayerTreeHostCommitter() { } >- >- virtual void commit(CCLayerTreeHost*, CCLayerTreeHostImpl*); >- >-protected: >- CCLayerTreeHostCommitter() { } >-}; >- >-} >- >-#endif >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp >index 4e2d1b843c1832cfafa14354862cbfa1538669ae..fea43532b145f8bfd72183fb59ca72efdd4bcada 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp >@@ -38,24 +38,23 @@ > > namespace WebCore { > >-PassOwnPtr<CCLayerTreeHostImpl> CCLayerTreeHostImpl::create(CCLayerTreeHostImplClient* client, PassRefPtr<LayerRendererChromium> renderer) >+PassOwnPtr<CCLayerTreeHostImpl> CCLayerTreeHostImpl::create(const CCSettings& settings) > { >- return adoptPtr(new CCLayerTreeHostImpl(client, renderer)); >+ return adoptPtr(new CCLayerTreeHostImpl( settings)); > } > >-CCLayerTreeHostImpl::CCLayerTreeHostImpl(CCLayerTreeHostImplClient* client, PassRefPtr<LayerRendererChromium> renderer) >+CCLayerTreeHostImpl::CCLayerTreeHostImpl(const CCSettings& settings) > : m_sourceFrameNumber(-1) > , m_frameNumber(0) >- , m_client(client) >- , m_commitPending(false) >- , m_layerRenderer(renderer) >- , m_redrawPending(false) >+ , m_settings(settings) > { > } > > CCLayerTreeHostImpl::~CCLayerTreeHostImpl() > { > TRACE_EVENT("CCLayerTreeHostImpl::~CCLayerTreeHostImpl()", this, 0); >+ if (m_layerRenderer) >+ m_layerRenderer->close(); > } > > void CCLayerTreeHostImpl::beginCommit() >@@ -64,71 +63,106 @@ void CCLayerTreeHostImpl::beginCommit() > > void CCLayerTreeHostImpl::commitComplete() > { >- m_commitPending = false; >- setNeedsRedraw(); > } > >-void CCLayerTreeHostImpl::drawLayers() >+GraphicsContext3D* CCLayerTreeHostImpl::context() > { >- // If a commit is pending, do not draw. This is a temporary restriction that >- // is necessary because drawLayers is currently a blocking operation on the main thread. >- if (m_commitPending) >- return; >+ return m_layerRenderer ? m_layerRenderer->context() : 0; >+} > >+void CCLayerTreeHostImpl::drawLayers() >+{ > TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0); >- ASSERT(m_redrawPending); >- m_redrawPending = false; >+ ASSERT(m_layerRenderer); >+ if (m_layerRenderer->owner()->rootLayer()) >+ m_layerRenderer->drawLayers(); > >- { >- TRACE_EVENT("CCLayerTreeHostImpl::drawLayersAndPresent", this, 0); >- CCCompletionEvent completion; >- bool contextLost; >- CCMainThread::postTask(createMainThreadTask(this, &CCLayerTreeHostImpl::drawLayersOnMainThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&contextLost))); >- completion.wait(); >+ ++m_frameNumber; >+} > >- // FIXME: Send the "UpdateRect" message up to the RenderWidget [or moveplugin equivalents...] >+void CCLayerTreeHostImpl::finishAllRendering() >+{ >+ m_layerRenderer->finish(); >+} > >- // FIXME: handle context lost >- if (contextLost) >- FATAL("LayerRendererChromiumImpl does not handle context lost yet."); >- } >+bool CCLayerTreeHostImpl::isContextLost() >+{ >+ ASSERT(m_layerRenderer); >+ return m_layerRenderer->isContextLost(); >+} > >- ++m_frameNumber; >+const LayerRendererCapabilities& CCLayerTreeHostImpl::layerRendererCapabilities() const >+{ >+ return m_layerRenderer->capabilities(); > } > >-void CCLayerTreeHostImpl::setNeedsCommitAndRedraw() >+void CCLayerTreeHostImpl::present() > { >- TRACE_EVENT("CCLayerTreeHostImpl::setNeedsCommitAndRedraw", this, 0); >+ ASSERT(m_layerRenderer && !isContextLost()); >+ m_layerRenderer->present(); >+} > >- // FIXME: move the requestFrameAndCommit out from here once we add framerate throttling/animation >- double frameBeginTime = currentTime(); >- m_commitPending = true; >- m_client->requestFrameAndCommitOnCCThread(frameBeginTime); >+void CCLayerTreeHostImpl::readback(void* pixels, const IntRect& rect) >+{ >+ m_layerRenderer->getFramebufferPixels(pixels, rect); > } > >-void CCLayerTreeHostImpl::setNeedsRedraw() >+void CCLayerTreeHostImpl::setRootLayer(PassRefPtr<CCLayerImpl> layer) > { >- if (m_redrawPending || m_commitPending) >- return; >+ m_rootLayerImpl = layer; >+} > >- TRACE_EVENT("CCLayerTreeHostImpl::setNeedsRedraw", this, 0); >- m_redrawPending = true; >- m_client->postDrawLayersTaskOnCCThread(); >+void CCLayerTreeHostImpl::setVisible(bool visible) >+{ >+ if (m_layerRenderer && !visible) >+ m_layerRenderer->releaseTextures(); > } > >-void CCLayerTreeHostImpl::drawLayersOnMainThread(CCCompletionEvent* completion, bool* contextLost) >+bool CCLayerTreeHostImpl::initializeLayerRenderer(CCLayerTreeHost* implHack, PassRefPtr<GraphicsContext3D> context) > { >- ASSERT(isMainThread()); >+ // If m_layerRenderer exists, then we are recovering from a lost context >+ bool recreatingRenderer = m_layerRenderer; >+ >+ // First time layerRenderer creation >+ RefPtr<LayerRendererChromium> layerRenderer; >+ if (!recreatingRenderer) >+ layerRenderer = LayerRendererChromium::create(implHack, this, context); >+ else >+ layerRenderer = LayerRendererChromium::create(m_layerRenderer->owner(), this, context); >+ >+ >+ // If creation failed, and we had asked for accelerated painting, disable accelerated painting >+ // and try creating the renderer again. >+ if (!layerRenderer && m_settings.acceleratePainting) { >+ m_settings.acceleratePainting = false; >+ >+ if (!recreatingRenderer) >+ layerRenderer = LayerRendererChromium::create(implHack, this, context); >+ else >+ layerRenderer = LayerRendererChromium::create(m_layerRenderer->owner(), this, context); >+ } > >- if (m_layerRenderer->owner()->rootLayer()) { >- m_layerRenderer->drawLayers(); >- m_layerRenderer->present(); >+ // If recreating renderer, update the layers to point at the new renderer >+ if (m_layerRenderer) >+ m_layerRenderer->rootLayer()->platformLayer()->setLayerRendererRecursive(layerRenderer.get()); > >- GraphicsContext3D* context = m_layerRenderer->context(); >- *contextLost = context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR; >- } else >- *contextLost = false; >- completion->signal(); >+ m_layerRenderer = layerRenderer; >+ return m_layerRenderer; >+} >+ >+// FIXME: move all this code to CCLayerTreeHost >+void CCLayerTreeHostImpl::updateLayers() >+{ >+ if (m_rootLayerImpl && m_layerRenderer) >+ m_layerRenderer->updateLayers(); >+} >+ >+void CCLayerTreeHostImpl::setViewport(const IntSize& viewportSize) >+{ >+ bool changed = viewportSize != m_viewportSize; >+ m_viewportSize = viewportSize; >+ if (changed) >+ m_layerRenderer->viewportChanged(); > } > > } >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h >index c411ccc73554f1dd32bcce2e15e48dbecac4a88e..d68bb8d6073390ebd084e914cab019261fa90788 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h >@@ -25,56 +25,69 @@ > #ifndef CCLayerTreeHostImpl_h > #define CCLayerTreeHostImpl_h > >-#include "cc/CCThread.h" >+#include "cc/CCLayerTreeHost.h" > #include <wtf/RefPtr.h> >-#include <wtf/ThreadSafeRefCounted.h> >+ >+#if USE(SKIA) >+class GrContext; >+#endif > > namespace WebCore { > > class CCCompletionEvent; >+class CCLayerImpl; > class LayerRendererChromium; >- >-// Provides scheduling infrastructure for a CCLayerTreeHostImpl >-class CCLayerTreeHostImplClient { >-public: >- virtual void postDrawLayersTaskOnCCThread() = 0; >- virtual void requestFrameAndCommitOnCCThread(double frameBeginTime) = 0; >- >-protected: >- virtual ~CCLayerTreeHostImplClient() { } >-}; >+struct LayerRendererCapabilities; > > // CCLayerTreeHostImpl owns the CCLayerImpl tree as well as associated rendering state > class CCLayerTreeHostImpl { > WTF_MAKE_NONCOPYABLE(CCLayerTreeHostImpl); > public: >- static PassOwnPtr<CCLayerTreeHostImpl> create(CCLayerTreeHostImplClient*, PassRefPtr<LayerRendererChromium>); >+ static PassOwnPtr<CCLayerTreeHostImpl> create(const CCSettings&); > virtual ~CCLayerTreeHostImpl(); > > virtual void beginCommit(); > virtual void commitComplete(); > >+ GraphicsContext3D* context(); >+ > void drawLayers(); > >+ void finishAllRendering(); > int frameNumber() const { return m_frameNumber; } > >- void setNeedsRedraw(); >- void setNeedsCommitAndRedraw(); >+ bool initializeLayerRenderer(CCLayerTreeHost* ownerHack, PassRefPtr<GraphicsContext3D>); >+ bool isContextLost(); >+ LayerRendererChromium* layerRenderer() { return m_layerRenderer.get(); } >+ const LayerRendererCapabilities& layerRendererCapabilities() const; >+ >+ void present(); >+ >+ void readback(void* pixels, const IntRect&); >+ >+ CCLayerImpl* rootLayer() const { return m_rootLayerImpl.get(); } >+ void setRootLayer(PassRefPtr<CCLayerImpl>); >+ >+ void setVisible(bool); > > int sourceFrameNumber() const { return m_sourceFrameNumber; } > void setSourceFrameNumber(int frameNumber) { m_sourceFrameNumber = frameNumber; } > >+ void updateLayers(); >+ >+ void setViewport(const IntSize& viewportSize); >+ const IntSize& viewportSize() const { return m_viewportSize; } >+ > protected: >- CCLayerTreeHostImpl(CCLayerTreeHostImplClient*, PassRefPtr<LayerRendererChromium>); >- void drawLayersOnMainThread(CCCompletionEvent*, bool* contextLost); >+ explicit CCLayerTreeHostImpl(const CCSettings&); > int m_sourceFrameNumber; > int m_frameNumber; > > private: >- CCLayerTreeHostImplClient* m_client; >- bool m_commitPending; > RefPtr<LayerRendererChromium> m_layerRenderer; >- bool m_redrawPending; >+ RefPtr<CCLayerImpl> m_rootLayerImpl; >+ CCSettings m_settings; >+ IntSize m_viewportSize; > }; > > }; >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp >deleted file mode 100644 >index a669288564596d878267661d3f9461ebfb662e98..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp >+++ /dev/null >@@ -1,235 +0,0 @@ >-/* >- * Copyright (C) 2011 Google 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" >- >-#include "cc/CCLayerTreeHostImplProxy.h" >- >-#include "TraceEvent.h" >-#include "cc/CCLayerTreeHost.h" >-#include "cc/CCMainThreadTask.h" >-#include "cc/CCThreadTask.h" >-#include <wtf/MainThread.h> >- >-using namespace WTF; >- >-namespace WebCore { >- >-namespace { >-CCThread* ccThread; >-int numProxies = 0; >-} >- >-CCLayerTreeHostImplProxy::CCLayerTreeHostImplProxy(CCLayerTreeHost* layerTreeHost) >- : m_commitPending(false) >- , m_layerTreeHost(layerTreeHost) >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::CCLayerTreeHostImplProxy", this, 0); >- ASSERT(isMainThread()); >- numProxies++; >- if (!ccThread) >- ccThread = layerTreeHost->client()->createCompositorThread().leakPtr(); >-} >- >- >-void CCLayerTreeHostImplProxy::start() >-{ >- // Create LayerTreeHostImpl. >- CCCompletionEvent completion; >- ccThread->postTask(createCCThreadTask(this, &CCLayerTreeHostImplProxy::initImplOnCCThread, AllowCrossThreadAccess(&completion))); >- completion.wait(); >-} >- >-CCLayerTreeHostImplProxy::~CCLayerTreeHostImplProxy() >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::~CCLayerTreeHostImplProxy", this, 0); >- ASSERT(isMainThread()); >- ASSERT(!m_layerTreeHostImpl && !m_layerTreeHost); // make sure stop() got called. >- >- numProxies--; >- if (!numProxies) { >- delete ccThread; >- ccThread = 0; >- } >-} >- >-bool CCLayerTreeHostImplProxy::isStarted() const >-{ >- return m_layerTreeHostImpl; >-} >- >-void CCLayerTreeHostImplProxy::setNeedsCommitAndRedraw() >-{ >- ASSERT(isMainThread()); >- if (m_commitPending) >- return; >- >- TRACE_EVENT("CCLayerTreeHostImplProxy::setNeedsCommitAndRedraw", this, 0); >- m_commitPending = true; >- ccThread->postTask(createCCThreadTask(this, &CCLayerTreeHostImplProxy::setNeedsCommitAndRedrawOnCCThread)); >-} >- >-void CCLayerTreeHostImplProxy::setNeedsRedraw() >-{ >- ASSERT(isMainThread()); >- ccThread->postTask(createCCThreadTask(this, &CCLayerTreeHostImplProxy::setNeedsRedrawOnCCThread)); >-} >- >-void CCLayerTreeHostImplProxy::stop() >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::stop", this, 0); >- ASSERT(isMainThread()); >- // Synchronously deletes the impl. >- CCCompletionEvent completion; >- ccThread->postTask(createCCThreadTask(this, &CCLayerTreeHostImplProxy::layerTreeHostClosedOnCCThread, AllowCrossThreadAccess(&completion))); >- completion.wait(); >- >- ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted. >- m_layerTreeHost = 0; >-} >- >-void CCLayerTreeHostImplProxy::postDrawLayersTaskOnCCThread() >-{ >- ASSERT(isImplThread()); >- if (m_layerTreeHostImpl) >- ccThread->postTask(createCCThreadTask(this, &CCLayerTreeHostImplProxy::drawLayersOnCCThread)); >-} >- >-void CCLayerTreeHostImplProxy::requestFrameAndCommitOnCCThread(double frameBeginTime) >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::requestFrameAndCommitOnCCThread", this, 0); >- ASSERT(isImplThread()); >- if (m_layerTreeHostImpl) >- CCMainThread::postTask(createMainThreadTask(this, &CCLayerTreeHostImplProxy::requestFrameAndCommit, frameBeginTime)); >-} >- >-#ifndef NDEBUG >-bool CCLayerTreeHostImplProxy::isMainThread() >-{ >- return ::isMainThread(); >-} >- >-#if USE(THREADED_COMPOSITING) >-bool CCLayerTreeHostImplProxy::isImplThread() >-{ >- return currentThread() == ccThread->threadID(); >-} >-#else >-namespace { >-bool fakeImplThread = false; >-} >- >-bool CCLayerTreeHostImplProxy::isImplThread() >-{ >- return fakeImplThread; >-} >- >-void CCLayerTreeHostImplProxy::setImplThread(bool value) >-{ >- fakeImplThread = value; >-} >-#endif // USE(THREADED_COMPOSITING) >- >-#endif // !NDEBUG >- >-void CCLayerTreeHostImplProxy::requestFrameAndCommit(double frameBeginTime) >-{ >- ASSERT(isMainThread()); >- if (!m_layerTreeHost) >- return; >- >- TRACE_EVENT("CCLayerTreeHostImplProxy::requestFrameAndCommit", this, 0); >- { >- TRACE_EVENT("CCLayerTreeHost::animateAndLayout", this, 0); >- m_layerTreeHost->animateAndLayout(frameBeginTime); >- } >- >- m_commitPending = false; >- >- OwnPtr<CCLayerTreeHostCommitter> committer = m_layerTreeHost->createLayerTreeHostCommitter(); >- m_layerTreeHost->beginCommit(); >- >- // Blocking call to CCLayerTreeHostImplProxy::performCommit >- CCCompletionEvent completion; >- ccThread->postTask(createCCThreadTask(this, &CCLayerTreeHostImplProxy::commitOnCCThread, AllowCrossThreadAccess(committer.get()), AllowCrossThreadAccess(&completion))); >- completion.wait(); >- >- committer.clear(); >- >- m_layerTreeHost->commitComplete(); >-} >- >-void CCLayerTreeHostImplProxy::commitOnCCThread(CCLayerTreeHostCommitter* committer, CCCompletionEvent* completion) >-{ >- ASSERT(isImplThread()); >- TRACE_EVENT("CCLayerTreeHostImplProxy::commitOnCCThread", this, 0); >- m_layerTreeHostImpl->beginCommit(); >- { >- TRACE_EVENT("CCLayerTreeHost::commit", this, 0); >- committer->commit(m_layerTreeHost, m_layerTreeHostImpl.get()); >- } >- completion->signal(); >- >- m_layerTreeHostImpl->commitComplete(); >-} >- >-void CCLayerTreeHostImplProxy::drawLayersOnCCThread() >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::drawLayersOnCCThread", this, 0); >- ASSERT(isImplThread()); >- if (m_layerTreeHostImpl) >- m_layerTreeHostImpl->drawLayers(); >-} >- >-void CCLayerTreeHostImplProxy::setNeedsCommitAndRedrawOnCCThread() >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::setNeedsCommitAndRedrawOnCCThread", this, 0); >- ASSERT(isImplThread() && m_layerTreeHostImpl); >- m_layerTreeHostImpl->setNeedsCommitAndRedraw(); >-} >- >-void CCLayerTreeHostImplProxy::setNeedsRedrawOnCCThread() >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::setNeedsRedrawOnCCThread", this, 0); >- ASSERT(isImplThread() && m_layerTreeHostImpl); >- m_layerTreeHostImpl->setNeedsRedraw(); >-} >- >-void CCLayerTreeHostImplProxy::initImplOnCCThread(CCCompletionEvent* completion) >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::initImplOnCCThread", this, 0); >- ASSERT(isImplThread()); >- m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this); >- completion->signal(); >-} >- >-void CCLayerTreeHostImplProxy::layerTreeHostClosedOnCCThread(CCCompletionEvent* completion) >-{ >- TRACE_EVENT("CCLayerTreeHostImplProxy::layerTreeHostClosedOnCCThread", this, 0); >- ASSERT(isImplThread()); >- m_layerTreeHostImpl.clear(); >- completion->signal(); >-} >- >-} >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h >deleted file mode 100644 >index d0207e561762ac1ddf9dd878378d546356c787ba..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h >+++ /dev/null >@@ -1,92 +0,0 @@ >-/* >- * Copyright (C) 2011 Google 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 CCLayerTreeHostImplProxy_h >-#define CCLayerTreeHostImplProxy_h >- >-#include "cc/CCCompletionEvent.h" >-#include "cc/CCLayerTreeHostImpl.h" >-#include <wtf/OwnPtr.h> >- >-namespace WebCore { >- >-class CCLayerTreeHost; >-class CCLayerTreeHostCommitter; >- >-class CCLayerTreeHostImplProxy : public CCLayerTreeHostImplClient { >- WTF_MAKE_NONCOPYABLE(CCLayerTreeHostImplProxy); >-public: >- virtual ~CCLayerTreeHostImplProxy(); >- >- bool isStarted() const; >- >- void setNeedsCommitAndRedraw(); >- void setNeedsRedraw(); >- >- void start(); // Must be called before using the proxy. >- void stop(); // Must be called before deleting the proxy. >- >- // CCLayerTreeHostImplCient -- called on CCThread >- virtual void postDrawLayersTaskOnCCThread(); >- virtual void requestFrameAndCommitOnCCThread(double frameBeginTime); >- >-#ifndef NDEBUG >- static bool isMainThread(); >- static bool isImplThread(); >-#if !USE(THREADED_COMPOSITING) >- // Fake threaded compositing so we can catch incorrect usage. >- static void setImplThread(bool); >-#endif >-#endif >- >-protected: >- explicit CCLayerTreeHostImplProxy(CCLayerTreeHost*); >- virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl() = 0; >- CCLayerTreeHost* host() const { return m_layerTreeHost; } >- >-private: >- // Called on CCMainThread >- void requestFrameAndCommit(double frameBeginTime); >- >- // Called on CCThread >- void commitOnCCThread(CCLayerTreeHostCommitter*, CCCompletionEvent*); >- void drawLayersOnCCThread(); >- void initImplOnCCThread(CCCompletionEvent*); >- void setNeedsCommitAndRedrawOnCCThread(); >- void setNeedsRedrawOnCCThread(); >- void layerTreeHostClosedOnCCThread(CCCompletionEvent*); >- >- // Used on main-thread only. >- bool m_commitPending; >- >- // Accessed on main thread only. >- CCLayerTreeHost* m_layerTreeHost; >- >- // Used on the CCThread, but checked on main thread during initialization/shutdown. >- OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl; >-}; >- >-} >- >-#endif >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h b/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h >index fac6e643f05a18bbbaad57b29bbc03a6280eac8a..4c33baa07add357739ddb51761e847b74e51c334 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h >@@ -158,6 +158,88 @@ private: > P3 m_parameter3; > }; > >+ >+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4> >+class MainThreadTask4 : public CCMainThread::Task { >+public: >+ typedef void (T::*Method)(MP1, MP2, MP3, MP4); >+ typedef MainThreadTask4<T, P1, MP1, P2, MP2, P3, MP3, P4, MP4> MainThreadTaskImpl; >+ typedef typename CrossThreadTaskTraits<P1>::ParamType Param1; >+ typedef typename CrossThreadTaskTraits<P2>::ParamType Param2; >+ typedef typename CrossThreadTaskTraits<P3>::ParamType Param3; >+ typedef typename CrossThreadTaskTraits<P4>::ParamType Param4; >+ >+ static PassOwnPtr<MainThreadTaskImpl> create(T* instance, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4) >+ { >+ return adoptPtr(new MainThreadTaskImpl(instance, method, parameter1, parameter2, parameter3, parameter4)); >+ } >+ >+private: >+ MainThreadTask4(T* instance, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4) >+ : CCMainThread::Task(instance) >+ , m_method(method) >+ , m_parameter1(parameter1) >+ , m_parameter2(parameter2) >+ , m_parameter3(parameter3) >+ , m_parameter4(parameter4) >+ { >+ } >+ >+ virtual void performTask() >+ { >+ (*static_cast<T*>(instance()).*m_method)(m_parameter1, m_parameter2, m_parameter3, m_parameter4); >+ } >+ >+private: >+ Method m_method; >+ P1 m_parameter1; >+ P2 m_parameter2; >+ P3 m_parameter3; >+ P4 m_parameter4; >+}; >+ >+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5> >+class MainThreadTask5 : public CCMainThread::Task { >+public: >+ typedef void (T::*Method)(MP1, MP2, MP3, MP4, MP5); >+ typedef MainThreadTask5<T, P1, MP1, P2, MP2, P3, MP3, P4, MP4, P5, MP5> MainThreadTaskImpl; >+ typedef typename CrossThreadTaskTraits<P1>::ParamType Param1; >+ typedef typename CrossThreadTaskTraits<P2>::ParamType Param2; >+ typedef typename CrossThreadTaskTraits<P3>::ParamType Param3; >+ typedef typename CrossThreadTaskTraits<P4>::ParamType Param4; >+ typedef typename CrossThreadTaskTraits<P5>::ParamType Param5; >+ >+ static PassOwnPtr<MainThreadTaskImpl> create(T* instance, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5) >+ { >+ return adoptPtr(new MainThreadTaskImpl(instance, method, parameter1, parameter2, parameter3, parameter4, parameter5)); >+ } >+ >+private: >+ MainThreadTask5(T* instance, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5) >+ : CCMainThread::Task(instance) >+ , m_method(method) >+ , m_parameter1(parameter1) >+ , m_parameter2(parameter2) >+ , m_parameter3(parameter3) >+ , m_parameter4(parameter4) >+ , m_parameter5(parameter5) >+ { >+ } >+ >+ virtual void performTask() >+ { >+ (*static_cast<T*>(instance()).*m_method)(m_parameter1, m_parameter2, m_parameter3, m_parameter4, m_parameter5); >+ } >+ >+private: >+ Method m_method; >+ P1 m_parameter1; >+ P2 m_parameter2; >+ P3 m_parameter3; >+ P4 m_parameter4; >+ P5 m_parameter5; >+}; >+ > template<typename T> > PassOwnPtr<CCMainThread::Task> createMainThreadTask( > T* const callee, >@@ -215,6 +297,46 @@ PassOwnPtr<CCMainThread::Task> createMainThreadTask( > CrossThreadCopier<P3>::copy(parameter3)); > } > >+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4> >+PassOwnPtr<CCMainThread::Task> createMainThreadTask( >+ T* const callee, >+ void (T::*method)(MP1, MP2, MP3, MP4), >+ const P1& parameter1, >+ const P2& parameter2, >+ const P3& parameter3, >+ const P4& parameter4) >+{ >+ return MainThreadTask4<T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3, typename CrossThreadCopier<P4>::Type, MP4>::create( >+ callee, >+ method, >+ CrossThreadCopier<P1>::copy(parameter1), >+ CrossThreadCopier<P2>::copy(parameter2), >+ CrossThreadCopier<P3>::copy(parameter3), >+ CrossThreadCopier<P4>::copy(parameter4)); >+ >+} >+ >+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5> >+PassOwnPtr<CCMainThread::Task> createMainThreadTask( >+ T* const callee, >+ void (T::*method)(MP1, MP2, MP3, MP4, MP5), >+ const P1& parameter1, >+ const P2& parameter2, >+ const P3& parameter3, >+ const P4& parameter4, >+ const P5& parameter5) >+{ >+ return MainThreadTask5<T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3, typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5>::create( >+ callee, >+ method, >+ CrossThreadCopier<P1>::copy(parameter1), >+ CrossThreadCopier<P2>::copy(parameter2), >+ CrossThreadCopier<P3>::copy(parameter3), >+ CrossThreadCopier<P4>::copy(parameter4), >+ CrossThreadCopier<P5>::copy(parameter5)); >+ >+} >+ > } // namespace WebCore > >-#endif // CCMainThreadTask_h >+#endif // MainThreadTask_h >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp >index 63edcf0d67a684f5dbe0a12d5d9d262a0b14ac23..a9f450ed48245d81b0c43072ca393712d0dd3786 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp >@@ -31,7 +31,7 @@ > > #include "GraphicsContext3D.h" > #include "LayerRendererChromium.h" >-#include "cc/CCLayerTreeHostImplProxy.h" >+#include "cc/CCProxy.h" > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -48,7 +48,7 @@ CCPluginLayerImpl::~CCPluginLayerImpl() > > void CCPluginLayerImpl::draw() > { >- ASSERT(CCLayerTreeHostImplProxy::isImplThread()); >+ ASSERT(CCProxy::isImplThread()); > ASSERT(layerRenderer()); > const CCPluginLayerImpl::Program* program = layerRenderer()->pluginLayerProgram(); > ASSERT(program && program->initialized()); >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..d61a2e53ed230f967ee1d85dd083cbacf9c26718 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp >@@ -0,0 +1,67 @@ >+/* >+ * Copyright (C) 2011 Google 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" >+ >+#include "cc/CCProxy.h" >+ >+#include "TraceEvent.h" >+#include "cc/CCLayerTreeHost.h" >+#include "cc/CCMainThreadTask.h" >+#include "cc/CCThreadTask.h" >+#include <wtf/MainThread.h> >+ >+using namespace WTF; >+ >+namespace WebCore { >+ >+#ifndef NDEBUG >+bool CCProxy::isMainThread() >+{ >+ return ::isMainThread(); >+} >+ >+namespace { >+bool fakeImplThread = false; >+static WTF::ThreadIdentifier implThreadID; >+} >+ >+bool CCProxy::isImplThread() >+{ >+ return fakeImplThread || currentThread() == implThreadID; >+} >+ >+void CCProxy::setImplThread(bool isImplThread) >+{ >+ fakeImplThread = isImplThread; >+} >+ >+void CCProxy::setImplThread(WTF::ThreadIdentifier id) >+{ >+ implThreadID = id; >+} >+ >+#endif // !NDEBUG >+ >+} >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..745d2cdac0a9f93a189f4a10372ed07d5aa88beb >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h >@@ -0,0 +1,103 @@ >+/* >+ * Copyright (C) 2011 Google 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 CCProxy_h >+#define CCProxy_h >+ >+#include "IntRect.h" >+#include <wtf/Noncopyable.h> >+#include <wtf/PassOwnPtr.h> >+#include <wtf/PassRefPtr.h> >+#include <wtf/Threading.h> >+ >+#if USE(SKIA) >+class GrContext; >+#endif >+ >+namespace WebCore { >+ >+class CCThread; >+class CCLayerTreeHost; >+class CCLayerTreeHostImpl; >+class CCLayerTreeHostImplClient; >+class GraphicsContext3D; >+struct LayerRendererCapabilities; >+class TextureManager; >+ >+// Abstract class responsible for proxying commands from the main-thread side of >+// the compositor over to the compositor implementation. >+class CCProxy { >+ WTF_MAKE_NONCOPYABLE(CCProxy); >+public: >+ virtual ~CCProxy() { } >+ >+ virtual bool compositeAndReadback(void *pixels, const IntRect&) = 0; >+ >+ virtual void finishAllRendering() = 0; >+ >+ virtual bool isStarted() const = 0; >+ >+ virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack) = 0; >+ >+ virtual const LayerRendererCapabilities& layerRendererCapabilities() const = 0; >+ >+ virtual void setNeedsCommitAndRedraw() = 0; >+ virtual void setNeedsRedraw() = 0; >+ >+ virtual void start() = 0; // Must be called before using the proxy. >+ virtual void stop() = 0; // Must be called before deleting the proxy. >+ >+ // Debug hooks >+#ifndef NDEBUG >+ static bool isMainThread(); >+ static bool isImplThread(); >+#endif >+ >+ // Testing hooks >+ virtual void loseCompositorContext() = 0; >+ >+ // Horrible ugly hack to allow main threaded code to get to the GrContext >+ // for accelerated painting. Remove this ASAP. >+#if USE(SKIA) >+ virtual GrContext* skiaContext() = 0; >+#endif >+ >+ // Temporary hack while render_widget still does scheduling for CCLayerTreeHostMainThreadI >+ virtual GraphicsContext3D* context() = 0; >+ >+ // Temporary hack while LayerChromiums hold references to LayerRendererChromiums >+ virtual TextureManager* contentsTextureManager() = 0; >+ >+protected: >+ CCProxy() { } >+ friend class ScopedSetImplThread; >+#ifndef NDEBUG >+ static void setImplThread(bool); >+ static void setImplThread(WTF::ThreadIdentifier); >+#endif >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..58f5172142ab92acff81ae167c5549bfeee2a66a >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp >@@ -0,0 +1,261 @@ >+/* >+ * Copyright (C) 2011 Google 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" >+ >+#include "cc/CCSingleThreadProxy.h" >+ >+#include "GraphicsContext3D.h" >+#include "LayerRendererChromium.h" >+#include "TraceEvent.h" >+#include "cc/CCLayerTreeHost.h" >+#include "cc/CCMainThreadTask.h" >+#include <wtf/CurrentTime.h> >+ >+using namespace WTF; >+ >+namespace WebCore { >+ >+class ScopedSetImplThread { >+public: >+ ScopedSetImplThread() >+ { >+#ifndef NDEBUG >+ CCProxy::setImplThread(true); >+#endif >+ } >+ ~ScopedSetImplThread() >+ { >+#ifndef NDEBUG >+ CCProxy::setImplThread(false); >+#endif >+ } >+}; >+ >+PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost) >+{ >+ return adoptPtr(new CCSingleThreadProxy(layerTreeHost)); >+} >+ >+CCSingleThreadProxy::CCSingleThreadProxy(CCLayerTreeHost* layerTreeHost) >+ : m_layerTreeHost(layerTreeHost) >+ , m_commitPending(false) >+ , m_recreatingGraphicsContext(false) >+{ >+ TRACE_EVENT("CCSingleThreadProxy::CCSingleThreadProxy", this, 0); >+ ASSERT(isMainThread()); >+} >+ >+void CCSingleThreadProxy::start() >+{ >+ ScopedSetImplThread impl; >+ m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(); >+} >+ >+CCSingleThreadProxy::~CCSingleThreadProxy() >+{ >+ TRACE_EVENT("CCSingleThreadProxy::~CCSingleThreadProxy", this, 0); >+ ASSERT(isMainThread()); >+ ASSERT(!m_layerTreeHostImpl && !m_layerTreeHost); // make sure stop() got called. >+} >+ >+bool CCSingleThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect) >+{ >+ ASSERT(isMainThread()); >+ ScopedSetImplThread impl; >+ if (!doComposite()) >+ return false; >+ >+ m_layerTreeHostImpl->readback(pixels, rect); >+ >+ if (m_layerTreeHostImpl->isContextLost()) >+ return false; >+ >+ return true; >+} >+ >+GraphicsContext3D* CCSingleThreadProxy::context() >+{ >+ ASSERT(isMainThread()); >+ ScopedSetImplThread impl; >+ return m_layerTreeHostImpl->context(); >+} >+ >+void CCSingleThreadProxy::finishAllRendering() >+{ >+ ASSERT(isMainThread()); >+ ScopedSetImplThread impl; >+ m_layerTreeHostImpl->finishAllRendering(); >+} >+ >+bool CCSingleThreadProxy::isStarted() const >+{ >+ ASSERT(isMainThread()); >+ return m_layerTreeHostImpl; >+} >+ >+bool CCSingleThreadProxy::initializeLayerRenderer(CCLayerTreeHost* ownerHack) >+{ >+ RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); >+ if (!context) >+ return false; >+ ASSERT(context->hasOneRef()); >+ >+ { >+ ScopedSetImplThread impl; >+ return m_layerTreeHostImpl->initializeLayerRenderer(ownerHack, context); >+ } >+} >+ >+const LayerRendererCapabilities& CCSingleThreadProxy::layerRendererCapabilities() const >+{ >+ ScopedSetImplThread impl; >+ return m_layerTreeHostImpl->layerRendererCapabilities(); >+} >+ >+void CCSingleThreadProxy::loseCompositorContext() >+{ >+ m_recreatingGraphicsContext = true; >+} >+ >+void CCSingleThreadProxy::setNeedsCommitAndRedraw() >+{ >+ ASSERT(isMainThread()); >+ if (m_commitPending) >+ return; >+#if !USE(THREADED_COMPOSITING) >+ m_layerTreeHost->scheduleComposite(); >+#else >+ // Single threaded only works with THREADED_COMPOSITING. >+ CRASH(); >+#endif >+} >+ >+void CCSingleThreadProxy::setNeedsRedraw() >+{ >+ // FIXME: Once we move render_widget scheduling into this class, we can >+ // treat redraw requests more efficiently than commitAndRedraw requests. >+ setNeedsCommitAndRedraw(); >+} >+ >+void CCSingleThreadProxy::stop() >+{ >+ TRACE_EVENT("CCSingleThreadProxy::stop", this, 0); >+ ASSERT(isMainThread()); >+ { >+ ScopedSetImplThread impl; >+ m_layerTreeHostImpl.clear(); >+ } >+ m_layerTreeHost = 0; >+} >+ >+#if USE(SKIA) >+GrContext* CCSingleThreadProxy::skiaContext() >+{ >+ return m_layerTreeHostImpl->layerRenderer()->skiaContext(); >+} >+#endif >+ >+TextureManager* CCSingleThreadProxy::contentsTextureManager() >+{ >+ return m_layerTreeHostImpl->layerRenderer()->contentsTextureManager(); >+} >+ >+#if !USE(THREADED_COMPOSITING) >+// Called by the legacy scheduling path (e.g. where render_widget does the scheduling) >+void CCSingleThreadProxy::compositeImmediately() >+{ >+ // CompositeIfNeeded will not occur if !m_commitPending. So, set the bit so >+ // it succeeds. This hack can go away once the proxies assume full >+ // scheduling responsibility. >+ m_commitPending = true; >+ >+ compositeIfNeeded(); >+} >+#endif >+ >+void CCSingleThreadProxy::compositeIfNeeded() >+{ >+ if (m_commitPending) { >+ // Update >+ double frameBeginTime = currentTime(); >+ m_layerTreeHost->animateAndLayout(frameBeginTime); >+ >+ // Precommit is a temporary step we need to perform to push things like >+ // the viewport to the LayerTreeHostImpl, because >+ // LayerTreeHostImpl::updateLayers() isn't split into host and impl parts. >+ { >+ ScopedSetImplThread impl; >+ m_layerTreeHost->preCommit(m_layerTreeHostImpl.get()); >+ } >+ // This should become m_layerTreeHost->updateLayers() once we split apart >+ // LayerTreeHostImpl::updateLayers. >+ m_layerTreeHostImpl->updateLayers(); >+ >+ // Commit >+ { >+ ScopedSetImplThread impl; >+ m_layerTreeHostImpl->beginCommit(); >+ m_layerTreeHost->commitTo(m_layerTreeHostImpl.get()); >+ m_layerTreeHostImpl->commitComplete(); >+ } >+ >+ // Draw >+ if (doComposite()) >+ m_layerTreeHostImpl->present(); >+ } >+} >+ >+bool CCSingleThreadProxy::doComposite() >+{ >+ if (m_recreatingGraphicsContext) { >+ RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); >+ ASSERT(context->hasOneRef()); >+ bool ok = !m_layerTreeHostImpl->initializeLayerRenderer(0, context); >+ m_layerTreeHost->didRecreateGraphicsContext(ok); >+ m_recreatingGraphicsContext = false; >+ setNeedsCommitAndRedraw(); >+ return false; >+ } >+ >+ { >+ ScopedSetImplThread impl; >+ m_layerTreeHostImpl->drawLayers(); >+ if (m_layerTreeHostImpl->isContextLost()) { >+ // Trying to recover the context right here will not work if GPU process >+ // died. This is because GpuChannelHost::OnErrorMessage will only be >+ // called at the next iteration of the message loop, reverting our >+ // recovery attempts here. Instead, we detach the root layer from the >+ // renderer, recreate the renderer at the next message loop iteration >+ // and request a repaint yet again. >+ m_recreatingGraphicsContext = true; >+ setNeedsCommitAndRedraw(); >+ return false; >+ } >+ } >+ >+ return true; >+} >+ >+} >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..dc4e83aa38746362d628e2df7eb25e94e776f6b3 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h >@@ -0,0 +1,86 @@ >+/* >+ * Copyright (C) 2011 Google 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 CCSingleThreadProxy_h >+#define CCSingleThreadProxy_h >+ >+#include "cc/CCCompletionEvent.h" >+#include "cc/CCLayerTreeHostImpl.h" >+#include "cc/CCProxy.h" >+#include <wtf/OwnPtr.h> >+ >+namespace WebCore { >+ >+class CCLayerTreeHost; >+ >+class CCSingleThreadProxy : public CCProxy { >+public: >+ static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); >+ virtual ~CCSingleThreadProxy(); >+ >+ // CCProxy implementation >+ virtual bool compositeAndReadback(void *pixels, const IntRect&); >+ virtual GraphicsContext3D* context(); >+ virtual void finishAllRendering(); >+ virtual bool isStarted() const; >+ virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack); >+ virtual const LayerRendererCapabilities& layerRendererCapabilities() const; >+ virtual void loseCompositorContext(); >+ virtual void setNeedsCommitAndRedraw(); >+ virtual void setNeedsRedraw(); >+ virtual void start(); >+ virtual void stop(); >+ >+ // Horrible ugly hack to allow main threaded code to get to the GrContext >+ // for accelerated painting. Remove this ASAP. >+#if USE(SKIA) >+ virtual GrContext* skiaContext(); >+#endif >+ >+ // Temporary hack while LayerChromiums hold references to LayerRendererChromiums >+ virtual TextureManager* contentsTextureManager(); >+ >+ // Special case functions. >+#if !USE(THREADED_COMPOSITING) >+ void compositeImmediately(); >+#endif >+ >+private: >+ explicit CCSingleThreadProxy(CCLayerTreeHost*); >+ void compositeIfNeeded(); >+ bool doComposite(); >+ >+ // Accessed on main thread only. >+ CCLayerTreeHost* m_layerTreeHost; >+ >+ // Used on the CCThread, but checked on main thread during initialization/shutdown. >+ OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl; >+ >+ bool m_commitPending; >+ bool m_recreatingGraphicsContext; >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..ad0fbee41ffaf965c89c5734e4c724a7e7e4a2cd >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp >@@ -0,0 +1,283 @@ >+/* >+ * Copyright (C) 2011 Google 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" >+ >+#include "cc/CCThreadProxy.h" >+ >+#include "GraphicsContext3D.h" >+#include "TraceEvent.h" >+#include "cc/CCLayerTreeHost.h" >+#include "cc/CCMainThreadTask.h" >+#include "cc/CCThreadTask.h" >+#include <wtf/MainThread.h> >+ >+using namespace WTF; >+ >+namespace WebCore { >+ >+namespace { >+CCThread* ccThread; >+int numProxies = 0; >+} >+ >+PassOwnPtr<CCProxy> CCThreadProxy::create(CCLayerTreeHost* layerTreeHost) >+{ >+ return adoptPtr(new CCThreadProxy(layerTreeHost)); >+} >+ >+CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost) >+ : m_commitPending(false) >+ , m_layerTreeHost(layerTreeHost) >+{ >+ TRACE_EVENT("CCThreadProxy::CCThreadProxy", this, 0); >+ ASSERT(isMainThread()); >+ numProxies++; >+ if (!ccThread) { >+ ccThread = m_layerTreeHost->createCompositorThread().leakPtr(); >+#ifndef NDEBUG >+ CCProxy::setImplThread(ccThread->threadID()); >+#endif >+ } >+} >+ >+CCThreadProxy::~CCThreadProxy() >+{ >+ TRACE_EVENT("CCThreadProxy::~CCThreadProxy", this, 0); >+ ASSERT(isMainThread()); >+ ASSERT(!m_layerTreeHostImpl); // Make sure stop() got called. >+ ASSERT(!m_layerTreeHost); // Make sure stop() got called. >+ >+ numProxies--; >+ if (!numProxies) { >+ delete ccThread; >+ ccThread = 0; >+ } >+} >+ >+bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect) >+{ >+ ASSERT_NOT_REACHED(); >+ return false; >+} >+ >+GraphicsContext3D* CCThreadProxy::context() >+{ >+ ASSERT_NOT_REACHED(); >+ return 0; >+} >+ >+void CCThreadProxy::finishAllRendering() >+{ >+ ASSERT_NOT_REACHED(); >+} >+ >+bool CCThreadProxy::isStarted() const >+{ >+ return m_layerTreeHostImpl; >+} >+ >+bool CCThreadProxy::initializeLayerRenderer(CCLayerTreeHost* ownerHack) >+{ >+ RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); >+ if (!context) >+ return false; >+ ASSERT(context->hasOneRef()); >+ >+ // Leak the context pointer so we can transfer ownership of it to the other side... >+ GraphicsContext3D* contextPtr = context.release().leakRef(); >+ ASSERT(contextPtr->hasOneRef()); >+ >+ // Make a blocking call to initializeLayerRendererOnCCThread. The results of that call >+ // are pushed into the initializeSucceeded and capabilities local variables. >+ CCCompletionEvent completion; >+ bool initializeSucceeded; >+ LayerRendererCapabilities capabilities; >+ ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeLayerRendererOnCCThread, >+ AllowCrossThreadAccess(ownerHack), AllowCrossThreadAccess(contextPtr), >+ AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities))); >+ completion.wait(); >+ >+ if (initializeSucceeded) >+ m_layerRendererCapabilitiesMainThreadCopy = capabilities; >+ return initializeSucceeded; >+} >+ >+const LayerRendererCapabilities& CCThreadProxy::layerRendererCapabilities() const >+{ >+ return m_layerRendererCapabilitiesMainThreadCopy; >+} >+ >+void CCThreadProxy::loseCompositorContext() >+{ >+ ASSERT_NOT_REACHED(); >+} >+ >+void CCThreadProxy::setNeedsCommitAndRedraw() >+{ >+ ASSERT(isMainThread()); >+ if (m_commitPending) >+ return; >+ >+ TRACE_EVENT("CCThreadProxy::setNeedsCommitAndRedraw", this, 0); >+ m_commitPending = true; >+ ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::setNeedsCommitAndRedrawOnCCThread)); >+} >+ >+void CCThreadProxy::setNeedsRedraw() >+{ >+ ASSERT(isMainThread()); >+ ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::setNeedsRedrawOnCCThread)); >+} >+ >+void CCThreadProxy::start() >+{ >+ // Create LayerTreeHostImpl. >+ CCCompletionEvent completion; >+ ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeImplOnCCThread, AllowCrossThreadAccess(&completion))); >+ completion.wait(); >+} >+ >+void CCThreadProxy::stop() >+{ >+ TRACE_EVENT("CCThreadProxy::stop", this, 0); >+ ASSERT(isMainThread()); >+ // Synchronously deletes the impl. >+ CCCompletionEvent completion; >+ ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::layerTreeHostClosedOnCCThread, AllowCrossThreadAccess(&completion))); >+ completion.wait(); >+ >+ ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted. >+ m_layerTreeHost = 0; >+} >+ >+#if USE(SKIA) >+GrContext* CCThreadProxy::skiaContext() >+{ >+ // Not supported on the impl thread. >+ ASSERT_NOT_REACHED(); >+ CRASH(); >+ return 0; >+} >+#endif >+ >+TextureManager* CCThreadProxy::contentsTextureManager() >+{ >+ ASSERT_NOT_REACHED(); >+ return 0; >+} >+ >+void CCThreadProxy::beginFrameAndCommitOnCCThread() >+{ >+ TRACE_EVENT("CCThreadProxy::beginFrameAndCommitOnCCThread", this, 0); >+ ASSERT(isImplThread()); >+ ASSERT_NOT_REACHED(); >+ // FIXME: call beginFrameAndCommit on main thread >+} >+ >+void CCThreadProxy::beginFrameAndCommit(double frameBeginTime) >+{ >+ ASSERT(isMainThread()); >+ if (!m_layerTreeHost) >+ return; >+ >+ TRACE_EVENT("CCThreadProxy::requestFrameAndCommit", this, 0); >+ { >+ TRACE_EVENT("CCLayerTreeHost::animateAndLayout", this, 0); >+ m_layerTreeHost->animateAndLayout(frameBeginTime); >+ } >+ >+ m_commitPending = false; >+ >+ // Blocking call to CCThreadProxy::performCommit >+ CCCompletionEvent completion; >+ ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::commitOnCCThread, AllowCrossThreadAccess(&completion))); >+ completion.wait(); >+} >+ >+void CCThreadProxy::commitOnCCThread(CCCompletionEvent* completion) >+{ >+ ASSERT(isImplThread()); >+ TRACE_EVENT("CCThreadProxy::commitOnCCThread", this, 0); >+ m_layerTreeHostImpl->beginCommit(); >+ { >+ TRACE_EVENT("CCLayerTreeHost::commit", this, 0); >+ m_layerTreeHost->commitTo(m_layerTreeHostImpl.get()); >+ } >+ completion->signal(); >+ >+ m_layerTreeHostImpl->commitComplete(); >+ setNeedsRedrawOnCCThread(); >+} >+ >+void CCThreadProxy::drawLayersOnCCThread() >+{ >+ TRACE_EVENT("CCThreadProxy::drawLayersOnCCThread", this, 0); >+ ASSERT(isImplThread()); >+ if (m_layerTreeHostImpl) >+ m_layerTreeHostImpl->drawLayers(); >+} >+ >+void CCThreadProxy::setNeedsCommitAndRedrawOnCCThread() >+{ >+ TRACE_EVENT("CCThreadProxy::setNeedsCommitAndRedrawOnCCThread", this, 0); >+ ASSERT(isImplThread()); >+ ASSERT(m_layerTreeHostImpl); >+ ASSERT_NOT_REACHED(); >+} >+ >+void CCThreadProxy::setNeedsRedrawOnCCThread() >+{ >+ TRACE_EVENT("CCThreadProxy::setNeedsRedrawOnCCThread", this, 0); >+ ASSERT_NOT_REACHED(); >+} >+ >+void CCThreadProxy::initializeImplOnCCThread(CCCompletionEvent* completion) >+{ >+ TRACE_EVENT("CCThreadProxy::initializeImplOnCCThread", this, 0); >+ ASSERT(isImplThread()); >+ m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(); >+ completion->signal(); >+} >+ >+void CCThreadProxy::initializeLayerRendererOnCCThread(CCLayerTreeHost* ownerHack, GraphicsContext3D* contextPtr, CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities) >+{ >+ TRACE_EVENT("CCThreadProxy::initializeLayerRendererOnCCThread", this, 0); >+ ASSERT(isImplThread()); >+ RefPtr<GraphicsContext3D> context(adoptRef(contextPtr)); >+ *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(ownerHack, context); >+ if (*initializeSucceeded) >+ *capabilities = m_layerTreeHostImpl->layerRendererCapabilities(); >+ completion->signal(); >+} >+ >+void CCThreadProxy::layerTreeHostClosedOnCCThread(CCCompletionEvent* completion) >+{ >+ TRACE_EVENT("CCThreadProxy::layerTreeHostClosedOnCCThread", this, 0); >+ ASSERT(isImplThread()); >+ m_layerTreeHostImpl.clear(); >+ completion->signal(); >+} >+ >+} >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..fb6c448b0ceae7ebbd4682649aa79205d4ac5118 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h >@@ -0,0 +1,94 @@ >+/* >+ * Copyright (C) 2011 Google 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 CCThreadProxy_h >+#define CCThreadProxy_h >+ >+#include "cc/CCCompletionEvent.h" >+#include "cc/CCLayerTreeHostImpl.h" >+#include "cc/CCProxy.h" >+#include <wtf/OwnPtr.h> >+ >+namespace WebCore { >+ >+class CCLayerTreeHost; >+ >+class CCThreadProxy : public CCProxy { >+public: >+ static PassOwnPtr<CCProxy> create(CCLayerTreeHost*); >+ >+ virtual ~CCThreadProxy(); >+ >+ // CCProxy implementation >+ virtual bool compositeAndReadback(void *pixels, const IntRect&); >+ virtual GraphicsContext3D* context(); >+ virtual void finishAllRendering(); >+ virtual bool isStarted() const; >+ virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack); >+ virtual const LayerRendererCapabilities& layerRendererCapabilities() const; >+ virtual void loseCompositorContext(); >+ virtual void setNeedsCommitAndRedraw(); >+ virtual void setNeedsRedraw(); >+ virtual void start(); >+ virtual void stop(); >+ >+ // Horrible ugly hack to allow main threaded code to get to the GrContext >+ // for accelerated painting. Remove this ASAP. >+#if USE(SKIA) >+ virtual GrContext* skiaContext(); >+#endif >+ >+ // Temporary hack while LayerChromiums hold references to LayerRendererChromiums >+ virtual TextureManager* contentsTextureManager(); >+ >+private: >+ explicit CCThreadProxy(CCLayerTreeHost*); >+ >+ // Called on CCMainThread >+ void beginFrameAndCommit(double frameBeginTime); >+ >+ // Called on CCThread >+ void beginFrameAndCommitOnCCThread(); >+ void commitOnCCThread(CCCompletionEvent*); >+ void drawLayersOnCCThread(); >+ void initializeImplOnCCThread(CCCompletionEvent*); >+ void initializeLayerRendererOnCCThread(CCLayerTreeHost*, GraphicsContext3D*, CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*); >+ void setNeedsCommitAndRedrawOnCCThread(); >+ void setNeedsRedrawOnCCThread(); >+ void layerTreeHostClosedOnCCThread(CCCompletionEvent*); >+ >+ // Used on main-thread only. >+ bool m_commitPending; >+ >+ // Accessed on main thread only. >+ CCLayerTreeHost* m_layerTreeHost; >+ LayerRendererCapabilities m_layerRendererCapabilitiesMainThreadCopy; >+ >+ // Used on the CCThread, but checked on main thread during initialization/shutdown. >+ OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl; >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h b/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h >index 91c58e5d25b7bb286e216c4e068cbe109578f183..d8de4ab0346988769fbe2674fd323610c45d720c 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h >@@ -198,6 +198,48 @@ private: > P4 m_parameter4; > }; > >+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5> >+class CCThreadTask5 : public CCThread::Task { >+public: >+ typedef void (T::*Method)(MP1, MP2, MP3, MP4, MP5); >+ typedef CCThreadTask5<T, P1, MP1, P2, MP2, P3, MP3, P4, MP4, P5, MP5> CCThreadTaskImpl; >+ typedef typename CrossThreadTaskTraits<P1>::ParamType Param1; >+ typedef typename CrossThreadTaskTraits<P2>::ParamType Param2; >+ typedef typename CrossThreadTaskTraits<P3>::ParamType Param3; >+ typedef typename CrossThreadTaskTraits<P4>::ParamType Param4; >+ typedef typename CrossThreadTaskTraits<P5>::ParamType Param5; >+ >+ static PassOwnPtr<CCThreadTaskImpl> create(T* instance, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5) >+ { >+ return adoptPtr(new CCThreadTaskImpl(instance, method, parameter1, parameter2, parameter3, parameter4, parameter5)); >+ } >+ >+private: >+ CCThreadTask5(T* instance, Method method, Param1 parameter1, Param2 parameter2, Param3 parameter3, Param4 parameter4, Param5 parameter5) >+ : CCThread::Task(instance) >+ , m_method(method) >+ , m_parameter1(parameter1) >+ , m_parameter2(parameter2) >+ , m_parameter3(parameter3) >+ , m_parameter4(parameter4) >+ , m_parameter5(parameter5) >+ { >+ } >+ >+ virtual void performTask() >+ { >+ (*static_cast<T*>(instance()).*m_method)(m_parameter1, m_parameter2, m_parameter3, m_parameter4, m_parameter5); >+ } >+ >+private: >+ Method m_method; >+ P1 m_parameter1; >+ P2 m_parameter2; >+ P3 m_parameter3; >+ P4 m_parameter4; >+ P5 m_parameter5; >+}; >+ > template<typename T> > PassOwnPtr<CCThread::Task> createCCThreadTask( > T* const callee, >@@ -274,6 +316,27 @@ PassOwnPtr<CCThread::Task> createCCThreadTask( > > } > >+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5> >+PassOwnPtr<CCThread::Task> createCCThreadTask( >+ T* const callee, >+ void (T::*method)(MP1, MP2, MP3, MP4, MP5), >+ const P1& parameter1, >+ const P2& parameter2, >+ const P3& parameter3, >+ const P4& parameter4, >+ const P5& parameter5) >+{ >+ return CCThreadTask5<T, typename CrossThreadCopier<P1>::Type, MP1, typename CrossThreadCopier<P2>::Type, MP2, typename CrossThreadCopier<P3>::Type, MP3, typename CrossThreadCopier<P4>::Type, MP4, typename CrossThreadCopier<P5>::Type, MP5>::create( >+ callee, >+ method, >+ CrossThreadCopier<P1>::copy(parameter1), >+ CrossThreadCopier<P2>::copy(parameter2), >+ CrossThreadCopier<P3>::copy(parameter3), >+ CrossThreadCopier<P4>::copy(parameter4), >+ CrossThreadCopier<P5>::copy(parameter5)); >+ >+} >+ > } // namespace WebCore > > #endif // CCThreadTask_h >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp >index bf23bdefd9f3f5cb81186480dff81c37269199e2..5f5b25643a8bf84dc0e6a4f581cd0dc634421277 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp >@@ -31,7 +31,6 @@ > > #include "FloatQuad.h" > #include "LayerRendererChromium.h" >-#include "cc/CCLayerTreeHostImplProxy.h" > #include <wtf/text/WTFString.h> > > using namespace std; >diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp >index 4a55bca0a367d70f3874c6083d5363b5c64d6bf1..9ff1fccc9716c1242fe35fe690a2a802160d2f08 100644 >--- a/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp >+++ b/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp >@@ -32,7 +32,7 @@ > #include "GraphicsContext3D.h" > #include "LayerRendererChromium.h" > #include "NotImplemented.h" >-#include "cc/CCLayerTreeHostImplProxy.h" >+#include "cc/CCProxy.h" > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -79,7 +79,7 @@ void CCVideoLayerImpl::setTexture(size_t index, Platform3DObject textureId, cons > > void CCVideoLayerImpl::draw() > { >- ASSERT(CCLayerTreeHostImplProxy::isImplThread()); >+ ASSERT(CCProxy::isImplThread()); > > if (m_skipsDraw) > return; >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 046fb13c9b78f80cb9cfa2ac1a600056723f587c..75f73c0100dd748bd16b00401750a7d65be9f4aa 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,16 @@ >+2011-08-26 Nat Duca <nduca@chromium.org> >+ >+ [chromium] Introduce CCLayerTreeHostImplMainThreadProxy in order to move LayerRenderer to CCLayerTreeHostImpl >+ https://bugs.webkit.org/show_bug.cgi?id=66807 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * src/WebViewImpl.cpp: >+ (WebKit::WebViewImpl::setRootGraphicsLayer): >+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): >+ * tests/CCThreadTaskTest.cpp: >+ (WebCore::TEST): >+ > 2011-08-27 Peter Beverloo <peter@chromium.org> > > Teach the update and build scripts how to handle dependencies >diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp >index ce4b3f1eec943f4b2be9472c448bd145e9abeae4..dd22396782b3847d266e634dbcca47285b5cacd6 100644 >--- a/Source/WebKit/chromium/src/WebViewImpl.cpp >+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp >@@ -2517,9 +2517,7 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer) > m_layerTreeHost->setRootLayer(layer); > > IntRect damagedRect(0, 0, m_size.width, m_size.height); >- if (m_isAcceleratedCompositingActive) >- invalidateRootLayerRect(damagedRect); >- else >+ if (!m_isAcceleratedCompositingActive) > m_client->didInvalidateRect(damagedRect); > } > >@@ -2610,6 +2608,11 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) > WebCore::CCSettings ccSettings; > ccSettings.acceleratePainting = page()->settings()->acceleratedDrawingEnabled(); > ccSettings.compositeOffscreen = settings()->compositeToTextureEnabled(); >+#if USE(THREADED_COMPOSITING) >+ ccSettings.enableCompositorThread = true; >+#else >+ ccSettings.enableCompositorThread = false; >+#endif > ccSettings.showFPSCounter = settings()->showFPSCounter(); > ccSettings.showPlatformLayerTree = settings()->showPlatformLayerTree(); > >diff --git a/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp >index 1c5f87725266b088f6866746c8d3a1f963b577c2..d9943e713a20a4d7b09041a4eccf77d90b33b36b 100644 >--- a/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp >+++ b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp >@@ -41,6 +41,7 @@ public: > MOCK_METHOD2(method2, void(int a1, int a2)); > MOCK_METHOD3(method3, void(int a1, int a2, int a3)); > MOCK_METHOD4(method4, void(int a1, int a2, int a3, int a4)); >+ MOCK_METHOD5(method5, void(int a1, int a2, int a3, int a4, int a5)); > }; > > TEST(CCThreadTaskTest, runnableMethods) >@@ -51,12 +52,14 @@ TEST(CCThreadTaskTest, runnableMethods) > EXPECT_CALL(mock, method2(9, 8)).Times(1); > EXPECT_CALL(mock, method3(9, 8, 7)).Times(1); > EXPECT_CALL(mock, method4(9, 8, 7, 6)).Times(1); >+ EXPECT_CALL(mock, method5(9, 8, 7, 6, 5)).Times(1); > > createCCThreadTask(&mock, &Mock::method0)->performTask(); > createCCThreadTask(&mock, &Mock::method1, 9)->performTask(); > createCCThreadTask(&mock, &Mock::method2, 9, 8)->performTask(); > createCCThreadTask(&mock, &Mock::method3, 9, 8, 7)->performTask(); > createCCThreadTask(&mock, &Mock::method4, 9, 8, 7, 6)->performTask(); >+ createCCThreadTask(&mock, &Mock::method5, 9, 8, 7, 6, 5)->performTask(); > } > > } // namespace
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 66807
:
104906
|
104965
|
105123
|
105197
|
105271
|
105385
|
105505
|
105524
|
105536
|
105537
|
105589
|
105853
|
105871
|
105998