Bug 589632 - Fix LayerManagerD3D9 debug output r=Bas, a=blocking2.0

This commit is contained in:
Matt Woodrow 2010-09-03 15:50:29 +12:00
Родитель e23facece9
Коммит 40535b1e32
4 изменённых файлов: 16 добавлений и 11 удалений

Просмотреть файл

@ -291,12 +291,12 @@ LayerManager::Dump(FILE* aFile, const char* aPrefix)
nsCAutoString pfx(aPrefix); nsCAutoString pfx(aPrefix);
pfx += " "; pfx += " ";
if (!mRoot) { if (!GetRoot()) {
fprintf(file, "%s(null)", pfx.get()); fprintf(file, "%s(null)", pfx.get());
return; return;
} }
mRoot->Dump(file, pfx.get()); GetRoot()->Dump(file, pfx.get());
} }
void void
@ -317,12 +317,12 @@ LayerManager::Log(const char* aPrefix)
nsCAutoString pfx(aPrefix); nsCAutoString pfx(aPrefix);
pfx += " "; pfx += " ";
if (!mRoot) { if (!GetRoot()) {
MOZ_LAYERS_LOG(("%s(null)", pfx.get())); MOZ_LAYERS_LOG(("%s(null)", pfx.get()));
return; return;
} }
mRoot->Log(pfx.get()); GetRoot()->Log(pfx.get());
} }
void void

Просмотреть файл

@ -137,7 +137,7 @@ LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback,
void void
LayerManagerD3D9::SetRoot(Layer *aLayer) LayerManagerD3D9::SetRoot(Layer *aLayer)
{ {
mRootLayer = static_cast<LayerD3D9*>(aLayer->ImplData()); mRoot = aLayer;
} }
already_AddRefed<ThebesLayer> already_AddRefed<ThebesLayer>
@ -198,8 +198,8 @@ LayerManagerD3D9::Render()
device()->BeginScene(); device()->BeginScene();
if (mRootLayer) { if (mRoot) {
const nsIntRect *clipRect = mRootLayer->GetLayer()->GetClipRect(); const nsIntRect *clipRect = mRoot->GetClipRect();
RECT r; RECT r;
if (clipRect) { if (clipRect) {
r.left = (LONG)clipRect->x; r.left = (LONG)clipRect->x;
@ -213,7 +213,7 @@ LayerManagerD3D9::Render()
} }
device()->SetScissorRect(&r); device()->SetScissorRect(&r);
mRootLayer->RenderLayer(); static_cast<LayerD3D9*>(mRoot->ImplData())->RenderLayer();
} }
device()->EndScene(); device()->EndScene();

Просмотреть файл

@ -145,6 +145,10 @@ public:
mDeviceManager = nsnull; mDeviceManager = nsnull;
} }
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() const { return "D3D9"; }
#endif // MOZ_LAYERS_HAVE_LOG
private: private:
/* Device manager instance */ /* Device manager instance */
static DeviceManagerD3D9 *mDeviceManager; static DeviceManagerD3D9 *mDeviceManager;
@ -160,9 +164,6 @@ private:
*/ */
nsRefPtr<gfxContext> mTarget; nsRefPtr<gfxContext> mTarget;
/* Current root layer. */
LayerD3D9 *mRootLayer;
/* Callback info for current transaction */ /* Callback info for current transaction */
CallbackInfo mCurrentCallbackInfo; CallbackInfo mCurrentCallbackInfo;

Просмотреть файл

@ -293,6 +293,10 @@ public:
aFlipped); aFlipped);
} }
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() const { return "OGL"; }
#endif // MOZ_LAYERS_HAVE_LOG
private: private:
/** Widget associated with this layer manager */ /** Widget associated with this layer manager */
nsIWidget *mWidget; nsIWidget *mWidget;