Bug 1025491 - Remove the DumpAsPNG() code in FilterNodeSoftware.cpp. r=mstange

This commit is contained in:
Jonathan Watt 2014-06-15 01:34:01 +01:00
parent f9af183166
commit eaefe307f9
5 changed files with 5 additions and 30 deletions

View File

@ -19,22 +19,7 @@
// #define DEBUG_DUMP_SURFACES
#ifdef DEBUG_DUMP_SURFACES
#include "gfxImageSurface.h"
namespace mozilla {
namespace gfx {
static void
DumpAsPNG(SourceSurface* aSurface)
{
RefPtr<DataSourceSurface> dataSource = aSurface->GetDataSurface();
IntSize size = dataSource->GetSize();
nsRefPtr<gfxImageSurface> imageSurface =
new gfxImageSurface(dataSource->GetData(), gfxIntSize(size.width, size.height),
dataSource->Stride(),
aSurface->GetFormat() == SurfaceFormat::A8 ? gfxImageFormat::A8 : gfxImageFormat::ARGB32);
imageSurface->PrintAsDataURL();
}
} // namespace gfx
} // namespace mozilla
#include "gfxUtils.h" // not part of Moz2D
#endif
namespace mozilla {
@ -672,7 +657,7 @@ FilterNodeSoftware::Draw(DrawTarget* aDrawTarget,
#ifdef DEBUG_DUMP_SURFACES
printf("output from %s:\n", GetName());
printf("<img src='"); DumpAsPNG(result); printf("'>\n");
printf("<img src='"); gfxUtils::DumpAsDataURL(result); printf("'>\n");
printf("</pre>\n");
#endif
@ -852,7 +837,7 @@ FilterNodeSoftware::GetInputDataSourceSurface(uint32_t aInputEnumIndex,
}
#ifdef DEBUG_DUMP_SURFACES
printf("<img src='"); DumpAsPNG(result); printf("'></section>");
printf("<img src='"); gfxUtils::DumpAsDataURL(result); printf("'></section>");
#endif
MOZ_ASSERT(!result || result->GetSize() == aRect.Size(), "wrong surface size");

View File

@ -699,13 +699,6 @@ gfxASurface::DumpAsDataURL(FILE* aOutput)
WriteAsPNG_internal(aOutput, false);
}
void
gfxASurface::PrintAsDataURL()
{
WriteAsPNG_internal(stdout, false);
fprintf(stdout, "\n");
}
void
gfxASurface::CopyAsDataURL()
{

View File

@ -189,11 +189,6 @@ public:
*/
void DumpAsDataURL(FILE* aOutput = stdout);
/**
* Write as a PNG encoded Data URL to stdout.
*/
void PrintAsDataURL();
/**
* Copy a PNG encoded Data URL to the clipboard.
*/

View File

@ -5,6 +5,7 @@
#include "gfxUtils.h"
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "gfxPlatform.h"
#include "gfxDrawable.h"
#include "mozilla/gfx/2D.h"

View File

@ -26,6 +26,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "Framebuffer.h"
#include "gfxContext.h"
#include "gfxImageSurface.h"
#include "gfxPlatform.h"
#include "gfxUtils.h"
#include "GLContextProvider.h"