Bug 968872 - Remove TEXTURE_DEALLOCATE_DEFERRED flag. r=nical
[gecko.git] / gfx / layers / RenderTrace.h
blob335597f602f1ebbd9f7790764599fc1d88ed7f57
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.
9 //
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"
19 #include "nsRect.h"
21 namespace mozilla {
22 namespace layers {
24 class Layer;
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 {
36 public:
37 RenderTraceScope(const char *aComment, const char *aColor)
38 : mComment(aComment)
39 , mColor(aColor)
41 renderTraceEventStart(mComment, mColor);
43 ~RenderTraceScope() {
44 renderTraceEventEnd(mComment, mColor);
46 private:
47 const char *mComment;
48 const char *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