mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1173654 - Part 1: Add logging methods for SurfaceType and ImageFormat. r=Bas
--HG-- extra : transplant_source : %11%DF%CFw%EC%B1%03%D9%A8%27I%EEe%05%83%F1%FB%00%DD%AC
This commit is contained in:
parent
3792527c55
commit
a27a5947a8
@ -8,6 +8,7 @@
|
||||
#include "LayersLogging.h"
|
||||
#include <stdint.h> // for uint8_t
|
||||
#include "gfxColor.h" // for gfxRGBA
|
||||
#include "ImageTypes.h" // for ImageFormat
|
||||
#include "mozilla/gfx/Matrix.h" // for Matrix4x4, Matrix
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "nsDebug.h" // for NS_ERROR
|
||||
@ -337,6 +338,83 @@ AppendToString(std::stringstream& aStream, mozilla::gfx::SurfaceFormat format,
|
||||
case SurfaceFormat::A8: aStream << "SurfaceFormat::A8"; break;
|
||||
case SurfaceFormat::YUV: aStream << "SurfaceFormat::YUV"; break;
|
||||
case SurfaceFormat::UNKNOWN: aStream << "SurfaceFormat::UNKNOWN"; break;
|
||||
default:
|
||||
NS_ERROR("unknown surface format");
|
||||
aStream << "???";
|
||||
}
|
||||
|
||||
aStream << sfx;
|
||||
}
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, gfx::SurfaceType aType,
|
||||
const char* pfx, const char* sfx)
|
||||
{
|
||||
aStream << pfx;
|
||||
switch(aType) {
|
||||
case SurfaceType::DATA:
|
||||
aStream << "SurfaceType::DATA"; break;
|
||||
case SurfaceType::D2D1_BITMAP:
|
||||
aStream << "SurfaceType::D2D1_BITMAP"; break;
|
||||
case SurfaceType::D2D1_DRAWTARGET:
|
||||
aStream << "SurfaceType::D2D1_DRAWTARGET"; break;
|
||||
case SurfaceType::CAIRO:
|
||||
aStream << "SurfaceType::CAIRO"; break;
|
||||
case SurfaceType::CAIRO_IMAGE:
|
||||
aStream << "SurfaceType::CAIRO_IMAGE"; break;
|
||||
case SurfaceType::COREGRAPHICS_IMAGE:
|
||||
aStream << "SurfaceType::COREGRAPHICS_IMAGE"; break;
|
||||
case SurfaceType::COREGRAPHICS_CGCONTEXT:
|
||||
aStream << "SurfaceType::COREGRAPHICS_CGCONTEXT"; break;
|
||||
case SurfaceType::SKIA:
|
||||
aStream << "SurfaceType::SKIA"; break;
|
||||
case SurfaceType::DUAL_DT:
|
||||
aStream << "SurfaceType::DUAL_DT"; break;
|
||||
case SurfaceType::D2D1_1_IMAGE:
|
||||
aStream << "SurfaceType::D2D1_1_IMAGE"; break;
|
||||
case SurfaceType::RECORDING:
|
||||
aStream << "SurfaceType::RECORDING"; break;
|
||||
case SurfaceType::TILED:
|
||||
aStream << "SurfaceType::TILED"; break;
|
||||
default:
|
||||
NS_ERROR("unknown surface type");
|
||||
aStream << "???";
|
||||
}
|
||||
aStream << sfx;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, ImageFormat format,
|
||||
const char* pfx, const char* sfx)
|
||||
{
|
||||
aStream << pfx;
|
||||
switch (format) {
|
||||
case ImageFormat::PLANAR_YCBCR:
|
||||
aStream << "ImageFormat::PLANAR_YCBCR"; break;
|
||||
case ImageFormat::GRALLOC_PLANAR_YCBCR:
|
||||
aStream << "ImageFormat::GRALLOC_PLANAR_YCBCR"; break;
|
||||
case ImageFormat::GONK_CAMERA_IMAGE:
|
||||
aStream << "ImageFormat::GONK_CAMERA_IMAGE"; break;
|
||||
case ImageFormat::SHARED_RGB:
|
||||
aStream << "ImageFormat::SHARED_RGB"; break;
|
||||
case ImageFormat::CAIRO_SURFACE:
|
||||
aStream << "ImageFormat::CAIRO_SURFACE"; break;
|
||||
case ImageFormat::MAC_IOSURFACE:
|
||||
aStream << "ImageFormat::MAC_IOSURFACE"; break;
|
||||
case ImageFormat::SURFACE_TEXTURE:
|
||||
aStream << "ImageFormat::SURFACE_TEXTURE"; break;
|
||||
case ImageFormat::EGLIMAGE:
|
||||
aStream << "ImageFormat::EGLIMAGE"; break;
|
||||
case ImageFormat::D3D9_RGB32_TEXTURE:
|
||||
aStream << "ImageFormat::D3D9_RBG32_TEXTURE"; break;
|
||||
case ImageFormat::OVERLAY_IMAGE:
|
||||
aStream << "ImageFormat::OVERLAY_IMAGE"; break;
|
||||
case ImageFormat::D3D11_SHARE_HANDLE_TEXTURE:
|
||||
aStream << "ImageFormat::D3D11_SHARE_HANDLE_TEXTURE"; break;
|
||||
default:
|
||||
NS_ERROR("unknown image format");
|
||||
aStream << "???";
|
||||
}
|
||||
|
||||
aStream << sfx;
|
||||
|
@ -24,6 +24,8 @@ class Matrix4x4;
|
||||
template <class units> struct RectTyped;
|
||||
} // namespace gfx
|
||||
|
||||
enum class ImageFormat;
|
||||
|
||||
namespace layers {
|
||||
|
||||
void
|
||||
@ -210,6 +212,14 @@ void
|
||||
AppendToString(std::stringstream& aStream, mozilla::gfx::SurfaceFormat format,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, gfx::SurfaceType format,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, ImageFormat format,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
// Sometimes, you just want a string from a single value.
|
||||
template <typename T>
|
||||
std::string
|
||||
|
Loading…
x
Reference in New Issue
Block a user