1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // This is a general tool that will let you visualize platform operation.
7 // Currently used for the layer system, the general syntax allows this
8 // tools to be adapted to trace other operations.
10 // For the front end see: https://github.com/staktrace/rendertrace
12 // Uncomment this line to enable RENDERTRACE
13 //#define MOZ_RENDERTRACE
15 #ifndef GFX_RENDERTRACE_H
16 #define GFX_RENDERTRACE_H
18 #include "gfx3DMatrix.h"
26 void RenderTraceLayers(Layer
*aLayer
, const char *aColor
, const gfx3DMatrix aRootTransform
= gfx3DMatrix(), bool aReset
= true);
28 void RenderTraceInvalidateStart(Layer
*aLayer
, const char *aColor
, const nsIntRect aRect
);
29 void RenderTraceInvalidateEnd(Layer
*aLayer
, const char *aColor
);
31 void renderTraceEventStart(const char *aComment
, const char *aColor
);
32 void renderTraceEventEnd(const char *aComment
, const char *aColor
);
33 void renderTraceEventEnd(const char *aColor
);
35 struct RenderTraceScope
{
37 RenderTraceScope(const char *aComment
, const char *aColor
)
41 renderTraceEventStart(mComment
, mColor
);
44 renderTraceEventEnd(mComment
, mColor
);
51 #ifndef MOZ_RENDERTRACE
52 inline void RenderTraceLayers(Layer
*aLayer
, const char *aColor
, const gfx3DMatrix aRootTransform
, bool aReset
)
55 inline void RenderTraceInvalidateStart(Layer
*aLayer
, const char *aColor
, const nsIntRect aRect
)
58 inline void RenderTraceInvalidateEnd(Layer
*aLayer
, const char *aColor
)
61 inline void renderTraceEventStart(const char *aComment
, const char *aColor
)
64 inline void renderTraceEventEnd(const char *aComment
, const char *aColor
)
67 inline void renderTraceEventEnd(const char *aColor
)
70 #endif // MOZ_RENDERTRACE
75 #endif //GFX_RENDERTRACE_H