michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_LAYERSLOGGING_H michael@0: #define GFX_LAYERSLOGGING_H michael@0: michael@0: #include "FrameMetrics.h" // for FrameMetrics, etc michael@0: #include "GraphicsFilter.h" // for GraphicsFilter michael@0: #include "mozilla/gfx/Point.h" // for IntSize, etc michael@0: #include "mozilla/gfx/Types.h" // for Filter, SurfaceFormat michael@0: #include "mozilla/layers/CompositorTypes.h" // for TextureFlags michael@0: #include "nsAString.h" michael@0: #include "nsPrintfCString.h" // for nsPrintfCString michael@0: #include "nsRegion.h" // for nsIntRegion michael@0: #include "nscore.h" // for nsACString, etc michael@0: michael@0: class gfx3DMatrix; michael@0: struct gfxRGBA; michael@0: struct nsIntPoint; michael@0: struct nsIntRect; michael@0: struct nsIntSize; michael@0: michael@0: namespace mozilla { michael@0: namespace gfx { michael@0: class Matrix4x4; michael@0: template struct RectTyped; michael@0: } michael@0: michael@0: namespace layers { michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const void* p, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const GraphicsFilter& f, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, FrameMetrics::ViewID n, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const gfxRGBA& c, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const gfx3DMatrix& m, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const nsIntPoint& p, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: template michael@0: nsACString& michael@0: AppendToString(nsACString& s, const mozilla::gfx::PointTyped& p, michael@0: const char* pfx="", const char* sfx="") michael@0: { michael@0: s += pfx; michael@0: s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y); michael@0: return s += sfx; michael@0: } michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const nsIntRect& r, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: template michael@0: nsACString& michael@0: AppendToString(nsACString& s, const mozilla::gfx::RectTyped& r, michael@0: const char* pfx="", const char* sfx="") michael@0: { michael@0: s += pfx; michael@0: s.AppendPrintf( michael@0: "(x=%f, y=%f, w=%f, h=%f)", michael@0: r.x, r.y, r.width, r.height); michael@0: return s += sfx; michael@0: } michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const nsIntRegion& r, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const nsIntSize& sz, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const FrameMetrics& m, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const mozilla::gfx::IntSize& size, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const mozilla::gfx::Matrix4x4& m, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, const mozilla::gfx::Filter filter, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, mozilla::layers::TextureFlags flags, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: nsACString& michael@0: AppendToString(nsACString& s, mozilla::gfx::SurfaceFormat format, michael@0: const char* pfx="", const char* sfx=""); michael@0: michael@0: } // namespace michael@0: } // namespace michael@0: michael@0: #endif /* GFX_LAYERSLOGGING_H */