From fdc9fcd88343deb6414572b7c54719c73a404c64 Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Fri, 24 Feb 2012 17:41:16 -0500 Subject: [PATCH] Improve RenderTrace. r=debug --HG-- extra : rebase_source : a01b6e678bca01848fe124b839c0e5433866fa58 --- gfx/layers/RenderTrace.cpp | 14 ++++++++++++++ gfx/layers/RenderTrace.h | 17 +++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/gfx/layers/RenderTrace.cpp b/gfx/layers/RenderTrace.cpp index 80043915941..95ed43b19c7 100644 --- a/gfx/layers/RenderTrace.cpp +++ b/gfx/layers/RenderTrace.cpp @@ -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); +} + } } diff --git a/gfx/layers/RenderTrace.h b/gfx/layers/RenderTrace.h index a8b49bfe8df..4ddf58e84db 100644 --- a/gfx/layers/RenderTrace.h +++ b/gfx/layers/RenderTrace.h @@ -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 }