|
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/. */ |
|
5 |
|
6 #ifndef GFX_LAYERSLOGGING_H |
|
7 #define GFX_LAYERSLOGGING_H |
|
8 |
|
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 |
|
18 |
|
19 class gfx3DMatrix; |
|
20 struct gfxRGBA; |
|
21 struct nsIntPoint; |
|
22 struct nsIntRect; |
|
23 struct nsIntSize; |
|
24 |
|
25 namespace mozilla { |
|
26 namespace gfx { |
|
27 class Matrix4x4; |
|
28 template <class units> struct RectTyped; |
|
29 } |
|
30 |
|
31 namespace layers { |
|
32 |
|
33 nsACString& |
|
34 AppendToString(nsACString& s, const void* p, |
|
35 const char* pfx="", const char* sfx=""); |
|
36 |
|
37 nsACString& |
|
38 AppendToString(nsACString& s, const GraphicsFilter& f, |
|
39 const char* pfx="", const char* sfx=""); |
|
40 |
|
41 nsACString& |
|
42 AppendToString(nsACString& s, FrameMetrics::ViewID n, |
|
43 const char* pfx="", const char* sfx=""); |
|
44 |
|
45 nsACString& |
|
46 AppendToString(nsACString& s, const gfxRGBA& c, |
|
47 const char* pfx="", const char* sfx=""); |
|
48 |
|
49 nsACString& |
|
50 AppendToString(nsACString& s, const gfx3DMatrix& m, |
|
51 const char* pfx="", const char* sfx=""); |
|
52 |
|
53 nsACString& |
|
54 AppendToString(nsACString& s, const nsIntPoint& p, |
|
55 const char* pfx="", const char* sfx=""); |
|
56 |
|
57 template<class T> |
|
58 nsACString& |
|
59 AppendToString(nsACString& s, const mozilla::gfx::PointTyped<T>& p, |
|
60 const char* pfx="", const char* sfx="") |
|
61 { |
|
62 s += pfx; |
|
63 s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y); |
|
64 return s += sfx; |
|
65 } |
|
66 |
|
67 nsACString& |
|
68 AppendToString(nsACString& s, const nsIntRect& r, |
|
69 const char* pfx="", const char* sfx=""); |
|
70 |
|
71 template<class T> |
|
72 nsACString& |
|
73 AppendToString(nsACString& s, const mozilla::gfx::RectTyped<T>& r, |
|
74 const char* pfx="", const char* sfx="") |
|
75 { |
|
76 s += pfx; |
|
77 s.AppendPrintf( |
|
78 "(x=%f, y=%f, w=%f, h=%f)", |
|
79 r.x, r.y, r.width, r.height); |
|
80 return s += sfx; |
|
81 } |
|
82 |
|
83 nsACString& |
|
84 AppendToString(nsACString& s, const nsIntRegion& r, |
|
85 const char* pfx="", const char* sfx=""); |
|
86 |
|
87 nsACString& |
|
88 AppendToString(nsACString& s, const nsIntSize& sz, |
|
89 const char* pfx="", const char* sfx=""); |
|
90 |
|
91 nsACString& |
|
92 AppendToString(nsACString& s, const FrameMetrics& m, |
|
93 const char* pfx="", const char* sfx=""); |
|
94 |
|
95 nsACString& |
|
96 AppendToString(nsACString& s, const mozilla::gfx::IntSize& size, |
|
97 const char* pfx="", const char* sfx=""); |
|
98 |
|
99 nsACString& |
|
100 AppendToString(nsACString& s, const mozilla::gfx::Matrix4x4& m, |
|
101 const char* pfx="", const char* sfx=""); |
|
102 |
|
103 nsACString& |
|
104 AppendToString(nsACString& s, const mozilla::gfx::Filter filter, |
|
105 const char* pfx="", const char* sfx=""); |
|
106 |
|
107 nsACString& |
|
108 AppendToString(nsACString& s, mozilla::layers::TextureFlags flags, |
|
109 const char* pfx="", const char* sfx=""); |
|
110 |
|
111 nsACString& |
|
112 AppendToString(nsACString& s, mozilla::gfx::SurfaceFormat format, |
|
113 const char* pfx="", const char* sfx=""); |
|
114 |
|
115 } // namespace |
|
116 } // namespace |
|
117 |
|
118 #endif /* GFX_LAYERSLOGGING_H */ |