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 #ifndef GFX_LAYERSLOGGING_H
7 #define GFX_LAYERSLOGGING_H
9 #include "FrameMetrics.h" // for FrameMetrics, etc
10 #include "GraphicsFilter.h" // for GraphicsFilter
11 #include "mozilla/gfx/Point.h" // for IntSize, etc
12 #include "mozilla/gfx/Types.h" // for Filter, SurfaceFormat
13 #include "mozilla/layers/CompositorTypes.h" // for TextureFlags
14 #include "nsAString.h"
15 #include "nsPrintfCString.h" // for nsPrintfCString
16 #include "nsRegion.h" // for nsIntRegion
17 #include "nscore.h" // for nsACString, etc
28 template <class units
> struct RectTyped
;
34 AppendToString(nsACString
& s
, const void* p
,
35 const char* pfx
="", const char* sfx
="");
38 AppendToString(nsACString
& s
, const GraphicsFilter
& f
,
39 const char* pfx
="", const char* sfx
="");
42 AppendToString(nsACString
& s
, FrameMetrics::ViewID n
,
43 const char* pfx
="", const char* sfx
="");
46 AppendToString(nsACString
& s
, const gfxRGBA
& c
,
47 const char* pfx
="", const char* sfx
="");
50 AppendToString(nsACString
& s
, const gfx3DMatrix
& m
,
51 const char* pfx
="", const char* sfx
="");
54 AppendToString(nsACString
& s
, const nsIntPoint
& p
,
55 const char* pfx
="", const char* sfx
="");
59 AppendToString(nsACString
& s
, const mozilla::gfx::PointTyped
<T
>& p
,
60 const char* pfx
="", const char* sfx
="")
63 s
+= nsPrintfCString("(x=%f, y=%f)", p
.x
, p
.y
);
68 AppendToString(nsACString
& s
, const nsIntRect
& r
,
69 const char* pfx
="", const char* sfx
="");
73 AppendToString(nsACString
& s
, const mozilla::gfx::RectTyped
<T
>& r
,
74 const char* pfx
="", const char* sfx
="")
78 "(x=%f, y=%f, w=%f, h=%f)",
79 r
.x
, r
.y
, r
.width
, r
.height
);
84 AppendToString(nsACString
& s
, const nsIntRegion
& r
,
85 const char* pfx
="", const char* sfx
="");
88 AppendToString(nsACString
& s
, const nsIntSize
& sz
,
89 const char* pfx
="", const char* sfx
="");
92 AppendToString(nsACString
& s
, const FrameMetrics
& m
,
93 const char* pfx
="", const char* sfx
="");
96 AppendToString(nsACString
& s
, const mozilla::gfx::IntSize
& size
,
97 const char* pfx
="", const char* sfx
="");
100 AppendToString(nsACString
& s
, const mozilla::gfx::Matrix4x4
& m
,
101 const char* pfx
="", const char* sfx
="");
104 AppendToString(nsACString
& s
, const mozilla::gfx::Filter filter
,
105 const char* pfx
="", const char* sfx
="");
108 AppendToString(nsACString
& s
, mozilla::layers::TextureFlags flags
,
109 const char* pfx
="", const char* sfx
="");
112 AppendToString(nsACString
& s
, mozilla::gfx::SurfaceFormat format
,
113 const char* pfx
="", const char* sfx
="");
118 #endif /* GFX_LAYERSLOGGING_H */