Improve RenderTrace. r=debug

--HG--
extra : rebase_source : a01b6e678bca01848fe124b839c0e5433866fa58
This commit is contained in:
Benoit Girard 2012-02-24 17:41:16 -05:00
parent b8ae25fc32
commit b31f45d2f0
2 changed files with 29 additions and 2 deletions

View File

@ -97,6 +97,20 @@ void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor) {
RenderTraceInvalidateStart(aLayer, aColor, nsIntRect());
}
void renderTraceEventStart(const char *aComment, const char *aColor) {
printf_stderr("%s RENDERTRACE %u fillrect #%s 0 0 10 10\n",
aComment, (int)PR_IntervalNow(), aColor);
}
void renderTraceEventEnd(const char *aComment, const char *aColor) {
printf_stderr("%s RENDERTRACE %u fillrect #%s 0 0 0 0\n",
aComment, (int)PR_IntervalNow(), aColor);
}
void renderTraceEventEnd(const char *aColor) {
renderTraceEventEnd("", aColor);
}
}
}

View File

@ -42,10 +42,10 @@
// For the front end see: https://github.com/staktrace/rendertrace
// Uncomment this line to enable RENDERTRACE
#define MOZ_RENDERTRACE
//#define MOZ_RENDERTRACE
#ifndef GFX_RENDERTRACE_H
//#define GFX_RENDERTRACE_H
#define GFX_RENDERTRACE_H
#include "gfx3DMatrix.h"
#include "nsRect.h"
@ -60,6 +60,10 @@ void RenderTraceLayers(Layer *aLayer, const char *aColor, const gfx3DMatrix aRoo
void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor, const nsIntRect aRect);
void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor);
void renderTraceEventStart(const char *aComment, const char *aColor);
void renderTraceEventEnd(const char *aComment, const char *aColor);
void renderTraceEventEnd(const char *aColor);
#ifndef MOZ_RENDERTRACE
inline void RenderTraceLayers(Layer *aLayer, const char *aColor, const gfx3DMatrix aRootTransform, bool aReset)
{}
@ -70,6 +74,15 @@ inline void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor, const
inline void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor)
{}
inline void renderTraceEventStart(const char *aComment, const char *aColor)
{}
inline void renderTraceEventEnd(const char *aComment, const char *aColor)
{}
inline void renderTraceEventEnd(const char *aColor)
{}
#endif // MOZ_RENDERTRACE
}