diff --git a/gfx/layers/composite/ContentHost.cpp b/gfx/layers/composite/ContentHost.cpp
index be29e990fcc3..8d3add90adc8 100644
--- a/gfx/layers/composite/ContentHost.cpp
+++ b/gfx/layers/composite/ContentHost.cpp
@@ -229,28 +229,26 @@ ContentHostBase::Dump(FILE* aFile,
const char* aPrefix,
bool aDumpHtml)
{
+ if (!aDumpHtml) {
+ return;
+ }
if (!aFile) {
aFile = stderr;
}
- if (aDumpHtml) {
- fprintf(aFile, "
");
- }
+ fprintf(aFile, "");
if (mDeprecatedTextureHost) {
fprintf(aFile, "%s", aPrefix);
- fprintf(aFile, aDumpHtml ? "- Front buffer
" : " ");
+ fprintf(aFile, "> Front buffer ");
}
if (mDeprecatedTextureHostOnWhite) {
fprintf(aFile, "%s", aPrefix);
- fprintf(aFile, aDumpHtml ? "- Front buffer on white
" : " ");
+ fprintf(aFile, "> Front buffer on white ");
}
- if (aDumpHtml) {
- fprintf(aFile, "
");
- }
-
+ fprintf(aFile, "
");
}
#endif
@@ -754,28 +752,26 @@ ContentHostDoubleBuffered::Dump(FILE* aFile,
bool aDumpHtml)
{
ContentHostBase::Dump(aFile, aPrefix, aDumpHtml);
+ if (!aDumpHtml) {
+ return;
+ }
if (!aFile) {
aFile = stderr;
}
- if (aDumpHtml) {
- fprintf(aFile, "");
- }
+ fprintf(aFile, "");
if (mBackHost) {
fprintf(aFile, "%s", aPrefix);
- fprintf(aFile, aDumpHtml ? "- Back buffer
" : " ");
+ fprintf(aFile, " >Back buffer");
}
if (mBackHostOnWhite) {
fprintf(aFile, "%s", aPrefix);
- fprintf(aFile, aDumpHtml ? "- Back buffer on white
" : " ");
+ fprintf(aFile, " >Back buffer on white ");
}
- if (aDumpHtml) {
- fprintf(aFile, "
");
- }
-
+ fprintf(aFile, "
");
}
#endif
diff --git a/gfx/layers/composite/ThebesLayerComposite.cpp b/gfx/layers/composite/ThebesLayerComposite.cpp
index 5e16995a7199..68d8f55d5ff1 100644
--- a/gfx/layers/composite/ThebesLayerComposite.cpp
+++ b/gfx/layers/composite/ThebesLayerComposite.cpp
@@ -114,7 +114,9 @@ ThebesLayerComposite::RenderLayer(const nsIntPoint& aOffset,
#ifdef MOZ_DUMP_PAINTING
if (gfxUtils::sDumpPainting) {
nsRefPtr surf = mBuffer->GetAsSurface();
- WriteSnapshotToDumpFile(this, surf);
+ if (surf) {
+ WriteSnapshotToDumpFile(this, surf);
+ }
}
#endif
@@ -158,7 +160,7 @@ ThebesLayerComposite::RenderLayer(const nsIntPoint& aOffset,
CompositableHost*
ThebesLayerComposite::GetCompositableHost()
{
- if ( mBuffer && mBuffer->IsAttached()) {
+ if (mBuffer && mBuffer->IsAttached()) {
return mBuffer.get();
}
diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp
index ff4ece8ec261..19c176a05af8 100644
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -1088,14 +1088,13 @@ void GrallocDeprecatedTextureHostOGL::SetCompositor(Compositor* aCompositor)
gfx::SurfaceFormat
GrallocDeprecatedTextureHostOGL::GetFormat() const
{
- if (mTextureTarget == LOCAL_GL_TEXTURE_EXTERNAL) {
- return gfx::FORMAT_R8G8B8A8;
+ switch (mTextureTarget) {
+ case LOCAL_GL_TEXTURE_EXTERNAL: return gfx::FORMAT_R8G8B8A8;
+ case LOCAL_GL_TEXTURE_2D: return mFormat;
+ default: return gfx::FORMAT_UNKNOWN;
}
- MOZ_ASSERT(mTextureTarget == LOCAL_GL_TEXTURE_2D);
- return mFormat;
}
-
void
GrallocDeprecatedTextureHostOGL::DeleteTextures()
{