Bug 958596 - Allow gfx/2d/Logging.h to be used outside of gfx/2d. r=Bas

This commit is contained in:
Botond Ballo 2014-02-18 21:59:34 -05:00
parent b418dc29c6
commit dd5c96c7ee
6 changed files with 19 additions and 10 deletions

View File

@ -7740,6 +7740,7 @@ XPCOM_LIBS="$LIBXUL_LIBS"
if test "$OS_ARCH" = "WINNT"; then
GKMEDIAS_SHARED_LIBRARY=1
AC_DEFINE(GKMEDIAS_SHARED_LIBRARY)
fi
AC_SUBST(GKMEDIAS_SHARED_LIBRARY)

View File

@ -53,8 +53,8 @@
#include "mozilla/CheckedInt.h"
#ifdef PR_LOGGING
PRLogModuleInfo *
#if defined(DEBUG) || defined(PR_LOGGING)
GFX2D_API PRLogModuleInfo *
GetGFX2DLog()
{
static PRLogModuleInfo *sLog;
@ -156,7 +156,7 @@ namespace mozilla {
namespace gfx {
// XXX - Need to define an API to set this.
int sGfxLogLevel = LOG_DEBUG;
GFX2D_API int sGfxLogLevel = LOG_DEBUG;
#ifdef WIN32
ID3D10Device1 *Factory::mD3D10Device;

View File

@ -14,13 +14,20 @@
#include "Matrix.h"
#ifdef WIN32
#include <windows.h>
// This file gets included from nsGlobalWindow.cpp, which doesn't like
// having windows.h included in it. Since OutputDebugStringA is the only
// thing we need from windows.h, we just declare it here directly.
// Note: the function's documented signature is
// WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString)
// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and
// LPCSTR are not defined, so we need to replace them with their expansions.
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
#endif
#ifdef PR_LOGGING
#if defined(DEBUG) || defined(PR_LOGGING)
#include <prlog.h>
extern PRLogModuleInfo *GetGFX2DLog();
extern GFX2D_API PRLogModuleInfo *GetGFX2DLog();
#endif
namespace mozilla {
@ -29,7 +36,7 @@ namespace gfx {
const int LOG_DEBUG = 1;
const int LOG_WARNING = 2;
#ifdef PR_LOGGING
#if defined(DEBUG) || defined(PR_LOGGING)
inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
switch (aLevel) {
@ -43,7 +50,7 @@ inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
#endif
extern int sGfxLogLevel;
extern GFX2D_API int sGfxLogLevel;
static inline void OutputMessage(const std::string &aString, int aLevel) {
#if defined(WIN32) && !defined(PR_LOGGING)

View File

@ -97,7 +97,7 @@ struct RectTyped :
Super(float(rect.x), float(rect.y),
float(rect.width), float(rect.height)) {}
GFX2D_API void NudgeToIntegers()
void NudgeToIntegers()
{
NudgeToInteger(&(this->x));
NudgeToInteger(&(this->y));

View File

@ -246,7 +246,7 @@ struct GradientStop
}
}
#if defined(XP_WIN) && defined(MOZ_GFX)
#if defined(XP_WIN) && defined(GKMEDIAS_SHARED_LIBRARY)
#ifdef GFX2D_INTERNAL
#define GFX2D_API __declspec(dllexport)
#else

View File

@ -21,6 +21,7 @@ EXPORTS.mozilla.gfx += [
'DataSurfaceHelpers.h',
'Filters.h',
'Helpers.h',
'Logging.h',
'Matrix.h',
'PathHelpers.h',
'Point.h',