diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index d622b01a5e9..35b2b4f8063 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -291,12 +291,12 @@ LayerManager::Dump(FILE* aFile, const char* aPrefix) nsCAutoString pfx(aPrefix); pfx += " "; - if (!mRoot) { + if (!GetRoot()) { fprintf(file, "%s(null)", pfx.get()); return; } - mRoot->Dump(file, pfx.get()); + GetRoot()->Dump(file, pfx.get()); } void @@ -317,12 +317,12 @@ LayerManager::Log(const char* aPrefix) nsCAutoString pfx(aPrefix); pfx += " "; - if (!mRoot) { + if (!GetRoot()) { MOZ_LAYERS_LOG(("%s(null)", pfx.get())); return; } - mRoot->Log(pfx.get()); + GetRoot()->Log(pfx.get()); } void diff --git a/gfx/layers/d3d9/LayerManagerD3D9.cpp b/gfx/layers/d3d9/LayerManagerD3D9.cpp index 1ba30089bc6..130c5ac57a3 100644 --- a/gfx/layers/d3d9/LayerManagerD3D9.cpp +++ b/gfx/layers/d3d9/LayerManagerD3D9.cpp @@ -137,7 +137,7 @@ LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback, void LayerManagerD3D9::SetRoot(Layer *aLayer) { - mRootLayer = static_cast(aLayer->ImplData()); + mRoot = aLayer; } already_AddRefed @@ -198,8 +198,8 @@ LayerManagerD3D9::Render() device()->BeginScene(); - if (mRootLayer) { - const nsIntRect *clipRect = mRootLayer->GetLayer()->GetClipRect(); + if (mRoot) { + const nsIntRect *clipRect = mRoot->GetClipRect(); RECT r; if (clipRect) { r.left = (LONG)clipRect->x; @@ -213,7 +213,7 @@ LayerManagerD3D9::Render() } device()->SetScissorRect(&r); - mRootLayer->RenderLayer(); + static_cast(mRoot->ImplData())->RenderLayer(); } device()->EndScene(); diff --git a/gfx/layers/d3d9/LayerManagerD3D9.h b/gfx/layers/d3d9/LayerManagerD3D9.h index d481f3fcf0f..f9a3e5b7661 100644 --- a/gfx/layers/d3d9/LayerManagerD3D9.h +++ b/gfx/layers/d3d9/LayerManagerD3D9.h @@ -145,6 +145,10 @@ public: mDeviceManager = nsnull; } +#ifdef MOZ_LAYERS_HAVE_LOG + virtual const char* Name() const { return "D3D9"; } +#endif // MOZ_LAYERS_HAVE_LOG + private: /* Device manager instance */ static DeviceManagerD3D9 *mDeviceManager; @@ -160,9 +164,6 @@ private: */ nsRefPtr mTarget; - /* Current root layer. */ - LayerD3D9 *mRootLayer; - /* Callback info for current transaction */ CallbackInfo mCurrentCallbackInfo; diff --git a/gfx/layers/opengl/LayerManagerOGL.h b/gfx/layers/opengl/LayerManagerOGL.h index dd054edafa4..e7d731ac5ba 100644 --- a/gfx/layers/opengl/LayerManagerOGL.h +++ b/gfx/layers/opengl/LayerManagerOGL.h @@ -293,6 +293,10 @@ public: aFlipped); } +#ifdef MOZ_LAYERS_HAVE_LOG + virtual const char* Name() const { return "OGL"; } +#endif // MOZ_LAYERS_HAVE_LOG + private: /** Widget associated with this layer manager */ nsIWidget *mWidget;