mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 936511 - Add layers.dump to dump layer tree. r=bas,nrc
This commit is contained in:
parent
50a3ec44d9
commit
5aa117f19b
@ -11,7 +11,6 @@
|
||||
|
||||
using namespace mozilla::layers;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
void
|
||||
TexturedEffect::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -55,4 +54,3 @@ EffectSolidColor::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
aTo += nsPrintfCString("EffectSolidColor (0x%p) [color=%x]", this, mColor.ToABGR());
|
||||
}
|
||||
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "mozilla/gfx/Rect.h" // for Rect
|
||||
#include "mozilla/gfx/Types.h" // for Filter, etc
|
||||
#include "mozilla/layers/CompositorTypes.h" // for EffectTypes, etc
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_HAVE_LOG
|
||||
#include "mozilla/layers/LayersTypes.h"
|
||||
#include "mozilla/layers/TextureHost.h" // for CompositingRenderTarget, etc
|
||||
#include "mozilla/mozalloc.h" // for operator delete, etc
|
||||
#include "nscore.h" // for nsACString
|
||||
@ -44,9 +44,7 @@ struct Effect : public RefCounted<Effect>
|
||||
EffectTypes mType;
|
||||
|
||||
virtual ~Effect() {}
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix) =0;
|
||||
#endif
|
||||
};
|
||||
|
||||
// Render from a texture
|
||||
@ -63,10 +61,8 @@ struct TexturedEffect : public Effect
|
||||
, mFilter(aFilter)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() = 0;
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
gfx::Rect mTextureCoords;
|
||||
TextureSource* mTexture;
|
||||
@ -87,9 +83,7 @@ struct EffectMask : public Effect
|
||||
, mMaskTransform(aMaskTransform)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
TextureSource* mMaskTexture;
|
||||
bool mIs3D;
|
||||
@ -105,10 +99,8 @@ struct EffectRenderTarget : public TexturedEffect
|
||||
, mRenderTarget(aRenderTarget)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectRenderTarget"; }
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
RefPtr<CompositingRenderTarget> mRenderTarget;
|
||||
};
|
||||
@ -122,9 +114,7 @@ struct EffectBGRX : public TexturedEffect
|
||||
: TexturedEffect(EFFECT_BGRX, aBGRXTexture, aPremultiplied, aFilter)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectBGRX"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
struct EffectRGBX : public TexturedEffect
|
||||
@ -135,9 +125,7 @@ struct EffectRGBX : public TexturedEffect
|
||||
: TexturedEffect(EFFECT_RGBX, aRGBXTexture, aPremultiplied, aFilter)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectRGBX"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
struct EffectBGRA : public TexturedEffect
|
||||
@ -148,9 +136,7 @@ struct EffectBGRA : public TexturedEffect
|
||||
: TexturedEffect(EFFECT_BGRA, aBGRATexture, aPremultiplied, aFilter)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectBGRA"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
struct EffectRGBA : public TexturedEffect
|
||||
@ -161,9 +147,7 @@ struct EffectRGBA : public TexturedEffect
|
||||
: TexturedEffect(EFFECT_RGBA, aRGBATexture, aPremultiplied, aFilter)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectRGBA"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
struct EffectYCbCr : public TexturedEffect
|
||||
@ -172,9 +156,7 @@ struct EffectYCbCr : public TexturedEffect
|
||||
: TexturedEffect(EFFECT_YCBCR, aSource, false, aFilter)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectYCbCr"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
struct EffectComponentAlpha : public TexturedEffect
|
||||
@ -187,9 +169,7 @@ struct EffectComponentAlpha : public TexturedEffect
|
||||
, mOnWhite(aOnWhite)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "EffectComponentAlpha"; }
|
||||
#endif
|
||||
|
||||
TextureSource* mOnBlack;
|
||||
TextureSource* mOnWhite;
|
||||
@ -202,9 +182,7 @@ struct EffectSolidColor : public Effect
|
||||
, mColor(aColor)
|
||||
{}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
gfx::Color mColor;
|
||||
};
|
||||
|
@ -42,13 +42,11 @@ const ViewID FrameMetrics::START_SCROLL_ID = 2;
|
||||
|
||||
uint8_t gLayerManagerLayerBuilder;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
FILE*
|
||||
FILEOrDefault(FILE* aFile)
|
||||
{
|
||||
return aFile ? aFile : stderr;
|
||||
}
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
@ -1131,8 +1129,6 @@ LayerManager::BeginTabSwitch()
|
||||
mTabSwitchStart = TimeStamp::Now();
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
static nsACString& PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite);
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
@ -1510,58 +1506,6 @@ PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite)
|
||||
return aTo;
|
||||
}
|
||||
|
||||
#else // !MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
void Layer::Dump(FILE* aFile, const char* aPrefix, bool aDumpHtml) {}
|
||||
void Layer::DumpSelf(FILE* aFile, const char* aPrefix) {}
|
||||
void Layer::Log(const char* aPrefix) {}
|
||||
void Layer::LogSelf(const char* aPrefix) {}
|
||||
nsACString&
|
||||
Layer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
ThebesLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
ContainerLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
ColorLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
CanvasLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
ImageLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
RefLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
nsACString&
|
||||
ReadbackLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
void LayerManager::Dump(FILE* aFile, const char* aPrefix, bool aDumpHtml) {}
|
||||
void LayerManager::DumpSelf(FILE* aFile, const char* aPrefix) {}
|
||||
void LayerManager::Log(const char* aPrefix) {}
|
||||
void LayerManager::LogSelf(const char* aPrefix) {}
|
||||
|
||||
nsACString&
|
||||
LayerManager::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{ return aTo; }
|
||||
|
||||
/*static*/ void LayerManager::InitLog() {}
|
||||
/*static*/ bool LayerManager::IsLogEnabled() { return false; }
|
||||
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
PRLogModuleInfo* LayerManager::sLog;
|
||||
|
||||
} // namespace layers
|
||||
|
@ -505,10 +505,6 @@ public:
|
||||
*/
|
||||
virtual bool NeedsWidgetInvalidation() { return true; }
|
||||
|
||||
// We always declare the following logging symbols, because it's
|
||||
// extremely tricky to conditionally declare them. However, for
|
||||
// ifndef MOZ_LAYERS_HAVE_LOG builds, they only have trivial
|
||||
// definitions in Layers.cpp.
|
||||
virtual const char* Name() const { return "???"; }
|
||||
|
||||
/**
|
||||
|
@ -9,10 +9,6 @@
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "nsPoint.h" // for nsIntPoint
|
||||
|
||||
// Debugging define.
|
||||
// To dump a layer tree call LayerManager::Dump()
|
||||
// #define MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#include <ui/GraphicBuffer.h>
|
||||
#endif
|
||||
|
@ -125,9 +125,7 @@ public:
|
||||
void SetTarget(gfxContext* aTarget) { mUsingDefaultTarget = false; mTarget = aTarget; }
|
||||
bool IsRetained() { return mWidget != nullptr; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const { return "Basic"; }
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
// Clear the cached contents of this layer tree.
|
||||
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
|
||||
|
@ -60,9 +60,7 @@ public:
|
||||
|
||||
virtual LayersBackend GetBackendType() { return LAYERS_CLIENT; }
|
||||
virtual void GetBackendName(nsAString& name);
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const { return "Client"; }
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
virtual void SetRoot(Layer* aLayer);
|
||||
|
||||
|
@ -120,7 +120,6 @@ CanvasLayerComposite::CleanupResources()
|
||||
mImageHost = nullptr;
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
nsACString&
|
||||
CanvasLayerComposite::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -133,5 +132,4 @@ CanvasLayerComposite::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
}
|
||||
return aTo;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -58,12 +58,10 @@ public:
|
||||
|
||||
void SetBounds(nsIntRect aBounds) { mBounds = aBounds; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const MOZ_OVERRIDE { return "CanvasLayerComposite"; }
|
||||
|
||||
protected:
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
private:
|
||||
RefPtr<CompositableHost> mImageHost;
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "Layers.h" // for ColorLayer, etc
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_HAVE_LOG
|
||||
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
|
||||
|
||||
struct nsIntPoint;
|
||||
@ -49,9 +48,7 @@ public:
|
||||
|
||||
virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const MOZ_OVERRIDE { return "ColorLayerComposite"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* layers */
|
||||
|
@ -282,9 +282,7 @@ public:
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() { return nullptr; }
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix) { }
|
||||
#endif
|
||||
|
||||
void AddTextureHost(TextureHost* aTexture);
|
||||
virtual void UseTextureHost(TextureHost* aTexture) {}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "Layers.h" // for Layer (ptr only), etc
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/layers/LayerManagerComposite.h"
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
class gfx3DMatrix;
|
||||
struct nsIntPoint;
|
||||
@ -53,9 +52,7 @@ public:
|
||||
// container layers don't use a compositable
|
||||
CompositableHost* GetCompositableHost() MOZ_OVERRIDE { return nullptr; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const MOZ_OVERRIDE { return "ContainerLayerComposite"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
class RefLayerComposite : public RefLayer,
|
||||
@ -90,9 +87,7 @@ public:
|
||||
// ref layers don't use a compositable
|
||||
CompositableHost* GetCompositableHost() MOZ_OVERRIDE { return nullptr; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const MOZ_OVERRIDE { return "RefLayerComposite"; }
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* layers */
|
||||
|
@ -716,7 +716,6 @@ ContentHostIncremental::TextureUpdateRequest::Execute(ContentHostIncremental* aH
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
void
|
||||
ContentHostSingleBuffered::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -763,7 +762,6 @@ ContentHostDoubleBuffered::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
mBackHost->PrintInfo(aTo, prefix.get());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
void
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "mozilla/layers/CompositorTypes.h" // for TextureInfo, etc
|
||||
#include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator
|
||||
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_HAVE_LOG, etc
|
||||
#include "mozilla/layers/LayersTypes.h" // for etc
|
||||
#include "mozilla/layers/TextureHost.h" // for DeprecatedTextureHost
|
||||
#include "mozilla/mozalloc.h" // for operator delete
|
||||
#include "nsAutoPtr.h" // for nsAutoPtr
|
||||
@ -183,9 +183,7 @@ public:
|
||||
bool aDumpHtml=false) MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
protected:
|
||||
nsIntRegion mValidRegionForNextBackBuffer;
|
||||
// Texture host for the back buffer. We never read or write this buffer. We
|
||||
@ -220,9 +218,7 @@ public:
|
||||
const TextureInfo& aTextureInfo) MOZ_OVERRIDE;
|
||||
virtual void DestroyTextures() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -151,7 +151,6 @@ ImageHost::Composite(EffectChain& aEffectChain,
|
||||
mFrontBuffer->Unlock();
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
void
|
||||
ImageHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -167,8 +166,6 @@ ImageHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
mFrontBuffer->PrintInfo(aTo, pfx.get());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
void
|
||||
@ -335,7 +332,6 @@ DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain,
|
||||
mDeprecatedTextureHost->Unlock();
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
void
|
||||
DeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -351,7 +347,6 @@ DeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
mDeprecatedTextureHost->PrintInfo(aTo, pfx.get());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
DeprecatedImageHostBuffered::Update(const SurfaceDescriptor& aImage,
|
||||
|
@ -68,9 +68,7 @@ public:
|
||||
|
||||
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
virtual void Dump(FILE* aFile=NULL,
|
||||
@ -130,9 +128,7 @@ public:
|
||||
|
||||
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
virtual void Dump(FILE* aFile=nullptr,
|
||||
|
@ -158,7 +158,6 @@ ImageLayerComposite::CleanupResources()
|
||||
mImageHost = nullptr;
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
nsACString&
|
||||
ImageLayerComposite::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -171,7 +170,6 @@ ImageLayerComposite::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
}
|
||||
return aTo;
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
|
@ -54,12 +54,10 @@ public:
|
||||
|
||||
virtual LayerComposite* AsLayerComposite() MOZ_OVERRIDE { return this; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const { return "ImageLayerComposite"; }
|
||||
|
||||
protected:
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
private:
|
||||
RefPtr<CompositableHost> mImageHost;
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "mozilla/layers/Compositor.h" // for Compositor
|
||||
#include "mozilla/layers/CompositorTypes.h"
|
||||
#include "mozilla/layers/Effects.h" // for Effect, EffectChain, etc
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_HAVE_LOG, etc
|
||||
#include "mozilla/layers/LayersTypes.h" // for etc
|
||||
#include "ipc/ShadowLayerUtils.h"
|
||||
#include "mozilla/mozalloc.h" // for operator new, etc
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
@ -318,6 +318,10 @@ LayerManagerComposite::Render()
|
||||
return;
|
||||
}
|
||||
|
||||
if (gfxPlatform::GetPrefLayersDump()) {
|
||||
this->Dump();
|
||||
}
|
||||
|
||||
if (mComposer2D && mComposer2D->TryRender(mRoot, mWorldMatrix)) {
|
||||
mCompositor->EndFrameForExternalComposition(mWorldMatrix);
|
||||
return;
|
||||
|
@ -158,9 +158,7 @@ public:
|
||||
void* GetThebesLayerCallbackData() const
|
||||
{ return mThebesLayerCallbackData; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const MOZ_OVERRIDE { return ""; }
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
enum WorldTransforPolicy {
|
||||
ApplyWorldTransform,
|
||||
|
@ -162,8 +162,6 @@ TextureHost::~TextureHost()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
void
|
||||
TextureHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -174,8 +172,6 @@ TextureHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
AppendToString(aTo, mFlags, " [flags=", "]");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
TextureSource::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
|
||||
{
|
||||
@ -246,8 +242,6 @@ DeprecatedTextureHost::SwapTextures(const SurfaceDescriptor& aImage,
|
||||
SetBuffer(mBuffer, mDeAllocator);
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
void
|
||||
DeprecatedTextureHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -257,7 +251,6 @@ DeprecatedTextureHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
AppendToString(aTo, GetFormat(), " [format=", "]");
|
||||
AppendToString(aTo, mFlags, " [flags=", "]");
|
||||
}
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
|
||||
|
||||
|
@ -384,10 +384,8 @@ public:
|
||||
|
||||
virtual void SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData);
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char *Name() { return "TextureHost"; }
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
uint64_t mID;
|
||||
@ -480,9 +478,7 @@ public:
|
||||
|
||||
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char *Name() MOZ_OVERRIDE { return "ShmemTextureHost"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
mozilla::ipc::Shmem* mShmem;
|
||||
@ -509,9 +505,7 @@ public:
|
||||
|
||||
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char *Name() MOZ_OVERRIDE { return "MemoryTextureHost"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
uint8_t* mBuffer;
|
||||
@ -664,10 +658,8 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() = 0;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char *Name() = 0;
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* TEMPORARY.
|
||||
|
@ -189,7 +189,6 @@ ThebesLayerComposite::GetEffectiveResolution()
|
||||
return resolution;
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
nsACString&
|
||||
ThebesLayerComposite::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -202,7 +201,6 @@ ThebesLayerComposite::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
}
|
||||
return aTo;
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
|
@ -79,9 +79,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
private:
|
||||
gfxSize GetEffectiveResolution();
|
||||
|
@ -306,7 +306,6 @@ TiledTexture::Validate(gfxReusableSurfaceWrapper* aReusableSurface, Compositor*
|
||||
mDeprecatedTextureHost->Update(aReusableSurface, flags, gfx::IntSize(aSize, aSize));
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
void
|
||||
TiledContentHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
{
|
||||
@ -314,7 +313,6 @@ TiledContentHost::PrintInfo(nsACString& aTo, const char* aPrefix)
|
||||
aTo += nsPrintfCString("TiledContentHost (0x%p)", this);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
void
|
||||
|
@ -245,9 +245,7 @@ public:
|
||||
bool aDumpHtml=false) MOZ_OVERRIDE;
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void ProcessUploadQueue(nsIntRegion* aNewValidRegion,
|
||||
|
@ -123,9 +123,7 @@ public:
|
||||
virtual LayersBackend GetBackendType() { return LAYERS_D3D10; }
|
||||
virtual void GetBackendName(nsAString& name) { name.AssignLiteral("Direct3D 10"); }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const { return "D3D10"; }
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
// Public helpers
|
||||
|
||||
|
@ -149,12 +149,10 @@ public:
|
||||
return nullptr; // TODO: cf bug 872568
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() MOZ_OVERRIDE
|
||||
{
|
||||
return "DeprecatedTextureHostShmemD3D11";
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual void BeginTileIteration() MOZ_OVERRIDE
|
||||
{
|
||||
@ -214,9 +212,7 @@ public:
|
||||
return nullptr; // TODO: cf bug 872568
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "DeprecatedTextureHostDXGID3D11"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void UpdateImpl(const SurfaceDescriptor& aSurface,
|
||||
@ -252,12 +248,10 @@ public:
|
||||
return nullptr; // TODO: cf bug 872568
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() MOZ_OVERRIDE
|
||||
{
|
||||
return "TextureImageDeprecatedTextureHostD3D11";
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void UpdateImpl(const SurfaceDescriptor& aSurface,
|
||||
|
@ -129,9 +129,7 @@ public:
|
||||
mDefaultDeviceManager = nullptr;
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const { return "D3D9"; }
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
void ReportFailure(const nsACString &aMsg, HRESULT aCode);
|
||||
|
||||
|
@ -148,9 +148,7 @@ protected:
|
||||
class DeprecatedTextureHostShmemD3D9 : public DeprecatedTextureHostD3D9
|
||||
{
|
||||
public:
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "DeprecatedTextureHostShmemD3D9"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void UpdateImpl(const SurfaceDescriptor& aSurface,
|
||||
@ -161,9 +159,7 @@ protected:
|
||||
class DeprecatedTextureHostSystemMemD3D9 : public DeprecatedTextureHostD3D9
|
||||
{
|
||||
public:
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "DeprecatedTextureHostSystemMemD3D9"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void UpdateImpl(const SurfaceDescriptor& aSurface,
|
||||
@ -194,12 +190,10 @@ public:
|
||||
return nullptr; // TODO: cf bug 872568
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() MOZ_OVERRIDE
|
||||
{
|
||||
return "TextureImageDeprecatedTextureHostD3D11";
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void UpdateImpl(const SurfaceDescriptor& aSurface,
|
||||
@ -213,9 +207,7 @@ private:
|
||||
class DeprecatedTextureHostDIB : public DeprecatedTextureHostD3D9
|
||||
{
|
||||
public:
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "DeprecatedTextureHostDIB"; }
|
||||
#endif
|
||||
virtual void SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator) MOZ_OVERRIDE
|
||||
{
|
||||
MOZ_ASSERT(aBuffer->type() == SurfaceDescriptor::TSurfaceDescriptorDIB);
|
||||
|
@ -110,9 +110,7 @@ public:
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() MOZ_OVERRIDE { return "GrallocTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
GrallocBufferActor* mGrallocActor;
|
||||
|
@ -264,9 +264,7 @@ public:
|
||||
GLenum aWrapMode = LOCAL_GL_REPEAT,
|
||||
bool aFlipped = false);
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() const { return "OGL"; }
|
||||
#endif // MOZ_LAYERS_HAVE_LOG
|
||||
|
||||
const nsIntSize& GetWidgetSize() {
|
||||
return mWidgetSize;
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "mozilla/gfx/Types.h" // for SurfaceFormat, etc
|
||||
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags
|
||||
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_HAVE_LOG
|
||||
#include "mozilla/layers/TextureHost.h" // for DeprecatedTextureHost, etc
|
||||
#include "mozilla/mozalloc.h" // for operator delete, etc
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
@ -338,9 +337,7 @@ public:
|
||||
|
||||
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "SharedTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
gfx::IntSize mSize;
|
||||
@ -442,9 +439,7 @@ public:
|
||||
mSurface->GetDevicePixelHeight());
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "MacIOSurfaceTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
CompositorOGL* mCompositor;
|
||||
@ -574,9 +569,7 @@ public:
|
||||
return DeprecatedTextureHost::GetFormat();
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "TextureImageDeprecatedTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsRefPtr<gl::TextureImage> mTexture;
|
||||
@ -686,9 +679,7 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "YCbCrDeprecatedTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
RefPtr<Channel> mYTexture;
|
||||
@ -778,9 +769,7 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "SharedDeprecatedTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void DeleteTextures();
|
||||
@ -859,9 +848,7 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "SurfaceStreamHostOGL"; }
|
||||
#endif
|
||||
|
||||
SurfaceStreamHostOGL()
|
||||
: mGL(nullptr)
|
||||
@ -923,9 +910,7 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "TiledDeprecatedTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void DeleteTextures();
|
||||
@ -993,9 +978,7 @@ public:
|
||||
|
||||
virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
virtual const char* Name() { return "GrallocDeprecatedTextureHostOGL"; }
|
||||
#endif
|
||||
|
||||
void BindTexture(GLenum aTextureUnit) MOZ_OVERRIDE;
|
||||
void UnbindTexture() MOZ_OVERRIDE {}
|
||||
|
@ -2030,6 +2030,7 @@ static bool sPrefLayersAccelerationForceEnabled = false;
|
||||
static bool sPrefLayersAccelerationDisabled = false;
|
||||
static bool sPrefLayersPreferOpenGL = false;
|
||||
static bool sPrefLayersPreferD3D9 = false;
|
||||
static bool sPrefLayersDump = false;
|
||||
static bool sLayersSupportsD3D9 = false;
|
||||
static int sPrefLayoutFrameRate = -1;
|
||||
static bool sBufferRotationEnabled = false;
|
||||
@ -2050,6 +2051,7 @@ InitLayersAccelerationPrefs()
|
||||
sPrefLayersAccelerationDisabled = Preferences::GetBool("layers.acceleration.disabled", false);
|
||||
sPrefLayersPreferOpenGL = Preferences::GetBool("layers.prefer-opengl", false);
|
||||
sPrefLayersPreferD3D9 = Preferences::GetBool("layers.prefer-d3d9", false);
|
||||
sPrefLayersDump = Preferences::GetBool("layers.dump", false);
|
||||
sPrefLayoutFrameRate = Preferences::GetInt("layout.frame_rate", -1);
|
||||
sBufferRotationEnabled = Preferences::GetBool("layers.bufferrotation.enabled", true);
|
||||
sComponentAlphaEnabled = Preferences::GetBool("layers.componentalpha.enabled", true);
|
||||
@ -2141,6 +2143,13 @@ gfxPlatform::GetPrefLayoutFrameRate()
|
||||
return sPrefLayoutFrameRate;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::GetPrefLayersDump()
|
||||
{
|
||||
InitLayersAccelerationPrefs();
|
||||
return sPrefLayersDump;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::BufferRotationEnabled()
|
||||
{
|
||||
|
@ -503,6 +503,7 @@ public:
|
||||
static bool GetPrefLayersPreferD3D9();
|
||||
static bool CanUseDirect3D9();
|
||||
static int GetPrefLayoutFrameRate();
|
||||
static bool GetPrefLayersDump();
|
||||
|
||||
static bool OffMainThreadCompositionRequired();
|
||||
|
||||
|
@ -4198,6 +4198,7 @@ pref("layers.acceleration.force-enabled", false);
|
||||
|
||||
pref("layers.acceleration.draw-fps", false);
|
||||
|
||||
pref("layers.dump", false);
|
||||
pref("layers.draw-borders", false);
|
||||
pref("layers.draw-tile-borders", false);
|
||||
pref("layers.draw-bigimage-borders", false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user