Bug 1187464 - Part 2. RTTI for TextureSource debug purposes. r=botond

This commit is contained in:
Milan Sreckovic 2016-02-02 11:06:00 +01:00
parent 2413ec54fb
commit e324817371
13 changed files with 43 additions and 1 deletions

View File

@ -34,6 +34,7 @@ class DataTextureSourceBasic : public DataTextureSource
, public TextureSourceBasic
{
public:
virtual const char* Name() const override { return "DataTextureSourceBasic"; }
virtual TextureSourceBasic* AsSourceBasic() override { return this; }
@ -451,7 +452,7 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
DrawOptions(aOpacity, blendMode),
sourceMask, &maskTransform);
} else {
gfxDevCrash(LogReason::IncompatibleBasicTexturedEffect) << "Bad for basic";
gfxDevCrash(LogReason::IncompatibleBasicTexturedEffect) << "Bad for basic with " << texturedEffect->mTexture->Name();
}
break;

View File

@ -23,6 +23,8 @@ public:
, mSize(aRect.Size())
{ }
virtual const char* Name() const override { return "BasicCompositingRenderTarget"; }
virtual gfx::IntSize GetSize() const override { return mSize; }
void BindRenderTarget();

View File

@ -31,6 +31,8 @@ public:
MacIOSurface* aSurface);
virtual ~MacIOSurfaceTextureSourceBasic();
virtual const char* Name() const override { return "MacIOSurfaceTextureSourceBasic"; }
virtual TextureSourceBasic* AsSourceBasic() override { return this; }
virtual gfx::IntSize GetSize() const override;

View File

@ -22,6 +22,8 @@ class X11DataTextureSourceBasic : public DataTextureSource
public:
X11DataTextureSourceBasic() {};
virtual const char* Name() const override { return "X11DataTextureSourceBasic"; }
virtual bool Update(gfx::DataSourceSurface* aSurface,
nsIntRegion* aDestRegion = nullptr,
gfx::IntPoint* aSrcOffset = nullptr) override;

View File

@ -24,6 +24,8 @@ class X11TextureSourceBasic
public:
X11TextureSourceBasic(BasicCompositor* aCompositor, gfxXlibSurface* aSurface);
virtual const char* Name() const override { return "X11TextureSourceBasic"; }
virtual X11TextureSourceBasic* AsSourceBasic() override { return this; }
virtual gfx::IntSize GetSize() const override;

View File

@ -374,6 +374,13 @@ TextureSource::~TextureSource()
MOZ_COUNT_DTOR(TextureSource);
}
const char*
TextureSource::Name() const
{
MOZ_CRASH("TextureSource without class name");
return "TextureSource";
}
BufferTextureHost::BufferTextureHost(const BufferDescriptor& aDesc,
TextureFlags aFlags)
: TextureHost(aFlags)

View File

@ -88,6 +88,8 @@ public:
virtual ~TextureSource();
virtual const char* Name() const = 0;
/**
* Should be overridden in order to deallocate the data that is associated
* with the rendering backend, such as GL textures.
@ -233,6 +235,8 @@ public:
: mUpdateSerial(0)
{}
virtual const char* Name() const override { return "DataTextureSource"; }
virtual DataTextureSource* AsDataTextureSource() override { return this; }
/**
@ -724,6 +728,8 @@ public:
{}
virtual ~CompositingRenderTarget() {}
virtual const char* Name() const override { return "CompositingRenderTarget"; }
#ifdef MOZ_DUMP_PAINTING
virtual already_AddRefed<gfx::DataSourceSurface> Dump(Compositor* aCompositor) { return nullptr; }
#endif

View File

@ -21,6 +21,8 @@ public:
// Called when the underlying X surface has been changed.
// Useful for determining whether to rebind a GLXPixmap to a texture.
virtual void Updated() = 0;
virtual const char* Name() const override { return "X11TextureSource"; }
};
// TextureHost for Xlib-backed TextureSources.

View File

@ -253,6 +253,7 @@ public:
virtual ~DataTextureSourceD3D11();
virtual const char* Name() const override { return "DataTextureSourceD3D11"; }
// DataTextureSource
@ -408,6 +409,8 @@ public:
const gfx::IntPoint& aOrigin,
DXGI_FORMAT aFormatOverride = DXGI_FORMAT_UNKNOWN);
virtual const char* Name() const override { return "CompositingRenderTargetD3D11"; }
virtual TextureSourceD3D11* AsSourceD3D11() override { return this; }
void BindRenderTarget(ID3D11DeviceContext* aContext);

View File

@ -112,6 +112,8 @@ public:
virtual ~DataTextureSourceD3D9();
virtual const char* Name() const override { return "DataTextureSourceD3D9"; }
// DataTextureSource
virtual bool Update(gfx::DataSourceSurface* aSurface,
@ -398,6 +400,8 @@ public:
const gfx::IntRect& aRect);
virtual ~CompositingRenderTargetD3D9();
virtual const char* Name() const override { return "CompositingRenderTargetD3D9"; }
virtual TextureSourceD3D9* AsSourceD3D9() override
{
MOZ_ASSERT(mTexture,

View File

@ -77,6 +77,8 @@ public:
~CompositingRenderTargetOGL();
virtual const char* Name() const override { return "CompositingRenderTargetOGL"; }
/**
* Create a render target around the default FBO, for rendering straight to
* the window.

View File

@ -28,6 +28,8 @@ public:
MacIOSurface* aSurface);
virtual ~MacIOSurfaceTextureSourceOGL();
virtual const char* Name() const override { return "MacIOSurfaceTextureSourceOGL"; }
virtual TextureSourceOGL* AsSourceOGL() override { return this; }
virtual void BindTexture(GLenum activetex, gfx::Filter aFilter) override;

View File

@ -142,6 +142,7 @@ public:
, mIterating(false)
{}
virtual const char* Name() const override { return "TextureImageTextureSourceOGL"; }
// DataTextureSource
virtual bool Update(gfx::DataSourceSurface* aSurface,
@ -237,6 +238,8 @@ public:
~GLTextureSource();
virtual const char* Name() const override { return "GLTextureSource"; }
virtual GLTextureSource* AsGLTextureSource() override { return this; }
virtual TextureSourceOGL* AsSourceOGL() override { return this; }
@ -344,6 +347,8 @@ public:
GLenum aWrapMode,
gfx::IntSize aSize);
virtual const char* Name() const override { return "SurfaceTextureSource"; }
virtual TextureSourceOGL* AsSourceOGL() { return this; }
virtual void BindTexture(GLenum activetex, gfx::Filter aFilter) override;
@ -436,6 +441,8 @@ public:
GLenum aWrapMode,
gfx::IntSize aSize);
virtual const char* Name() const override { return "EGLImageTextureSource"; }
virtual TextureSourceOGL* AsSourceOGL() override { return this; }
virtual void BindTexture(GLenum activetex, gfx::Filter aFilter) override;