Bug 1269892 - Dump the name of TextureSource when fails to cast it as TextureSourceOGL, r?nical
MozReview-Commit-ID: IAW98qk3987
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -106,17 +106,20 @@ public:
/**
* Return the pixel format of this texture
*/
virtual gfx::SurfaceFormat GetFormat() const { return gfx::SurfaceFormat::UNKNOWN; }
/**
* Cast to a TextureSource for for each backend..
*/
- virtual TextureSourceOGL* AsSourceOGL() { return nullptr; }
+ virtual TextureSourceOGL* AsSourceOGL() {
+ gfxCriticalNote << "Failed to cast " << Name() << " into a TextureSourceOGL";
+ return nullptr;
+ }
virtual TextureSourceD3D9* AsSourceD3D9() { return nullptr; }
virtual TextureSourceD3D11* AsSourceD3D11() { return nullptr; }
virtual TextureSourceBasic* AsSourceBasic() { return nullptr; }
/**
* Cast to a DataTextureSurce.
*/
virtual DataTextureSource* AsDataTextureSource() { return nullptr; }