зеркало из https://github.com/mozilla/gecko-dev.git
Misc thebes/cairo win32 compilation fixes
This commit is contained in:
Родитель
75853eee2e
Коммит
ec54927e83
|
@ -37,6 +37,8 @@
|
|||
#ifndef CAIRO_FEATURES_H
|
||||
#define CAIRO_FEATURES_H
|
||||
|
||||
#include "cairo-platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define CAIRO_BEGIN_DECLS extern "C" {
|
||||
# define CAIRO_END_DECLS }
|
||||
|
|
|
@ -49,10 +49,19 @@ LIBXUL_LIBRARY = 1
|
|||
REQUIRES = glitz
|
||||
|
||||
CSRCS = \
|
||||
glitz_wgl_context.c \
|
||||
glitz_wgl_drawable.c \
|
||||
glitz_wgl_extension.c \
|
||||
glitz_wgl_format.c \
|
||||
glitz_wgl_info.c \
|
||||
glitz_wgl_pbuffer.c \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_INCLUDES += -I$(srcdir) -I$(srcdir)/..
|
||||
|
||||
EXPORTS = glitz-wgl.h
|
||||
|
||||
FORCE_STATIC_LIB = 1
|
||||
FORCE_USE_PIC = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -61,8 +61,6 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
PRInt32 nsThebesDrawingSurface::mGlitzMode = -1;
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsThebesDrawingSurface, nsIDrawingSurface)
|
||||
|
||||
nsThebesDrawingSurface::nsThebesDrawingSurface()
|
||||
|
@ -328,23 +326,3 @@ static nsresult ConvertPixmapsGTK(GdkPixmap* aPmBlack, GdkPixmap* aPmWhite,
|
|||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool
|
||||
nsThebesDrawingSurface::UseGlitz()
|
||||
{
|
||||
#ifdef MOZ_ENABLE_GLITZ
|
||||
if (mGlitzMode == -1) {
|
||||
if (getenv("MOZ_GLITZ")) {
|
||||
glitz_glx_init (NULL);
|
||||
mGlitzMode = 1;
|
||||
} else {
|
||||
mGlitzMode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (mGlitzMode)
|
||||
return PR_TRUE;
|
||||
|
||||
#endif
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
|
|
@ -95,9 +95,6 @@ public:
|
|||
|
||||
nsresult PushFilter(const nsIntRect& aRect, PRBool aAreaIsOpaque, float aOpacity);
|
||||
void PopFilter();
|
||||
|
||||
static PRBool UseGlitz();
|
||||
static PRInt32 mGlitzMode;
|
||||
private:
|
||||
nsRefPtr<gfxASurface> mSurface;
|
||||
nsThebesDeviceContext *mDC;
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
#include "gfxContext.h"
|
||||
#include "gfxPattern.h"
|
||||
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#ifdef MOZ_ENABLE_GTK2
|
||||
#include <gdk/gdkx.h>
|
||||
#include "gfxXlibSurface.h"
|
||||
|
@ -193,7 +195,7 @@ nsThebesImage::Optimize(nsIDeviceContext* aContext)
|
|||
|
||||
if (!mOptSurface) {
|
||||
#ifdef MOZ_ENABLE_GTK2
|
||||
if (!nsThebesDrawingSurface::UseGlitz()) {
|
||||
if (!gfxPlatform::GetPlatform()->UseGlitz()) {
|
||||
XRenderPictFormat *fmt = nsnull;
|
||||
|
||||
if (mRealAlphaDepth == 0) {
|
||||
|
|
|
@ -61,6 +61,8 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include "gfxWindowsSurface.h"
|
||||
#endif
|
||||
|
@ -747,7 +749,7 @@ void*
|
|||
nsThebesRenderingContext::GetNativeGraphicData(GraphicDataType aType)
|
||||
{
|
||||
if (aType == NATIVE_GDK_DRAWABLE &&
|
||||
!nsThebesDrawingSurface::UseGlitz())
|
||||
!gfxPlatform::GetPlatform()->UseGlitz())
|
||||
{
|
||||
if (mWidget && mDrawingSurface == mLocalDrawingSurface)
|
||||
return mWidget->GetNativeData(NS_NATIVE_WIDGET);
|
||||
|
|
|
@ -61,9 +61,7 @@ public:
|
|||
/**
|
||||
* Force the glitz state to on or off
|
||||
*/
|
||||
static void SetUseGlitz(PRBool use) {
|
||||
mGlitzState = (use ? 1 : 0);
|
||||
}
|
||||
static void SetUseGlitz(PRBool use);
|
||||
|
||||
/**
|
||||
* Create an offscreen surface of the given dimensions
|
||||
|
@ -92,9 +90,6 @@ public:
|
|||
protected:
|
||||
gfxPlatform() { }
|
||||
~gfxPlatform() { }
|
||||
|
||||
static gfxPlatform *mPlatform;
|
||||
static int mGlitzState;
|
||||
};
|
||||
|
||||
#endif /* GFX_PLATFORM_H */
|
||||
|
|
|
@ -49,44 +49,50 @@
|
|||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
NS_EXPORT gfxPlatform *gfxPlatform::mPlatform = nsnull;
|
||||
NS_EXPORT int gfxPlatform::mGlitzState = -1;
|
||||
gfxPlatform *gPlatform = nsnull;
|
||||
int gGlitzState = -1;
|
||||
|
||||
gfxPlatform*
|
||||
gfxPlatform::GetPlatform()
|
||||
{
|
||||
if (!mPlatform) {
|
||||
if (!gPlatform) {
|
||||
#if defined(XP_WIN)
|
||||
// mPlatform = new gfxPlatformWindows;
|
||||
// gPlatform = new gfxPlatformWindows;
|
||||
return nsnull;
|
||||
#elif defined(XP_MACOSX)
|
||||
mPlatform = new gfxPlatformMac;
|
||||
gPlatform = new gfxPlatformMac;
|
||||
#elif defined(MOZ_WIDGET_GTK2)
|
||||
mPlatform = new gfxPlatformGtk;
|
||||
gPlatform = new gfxPlatformGtk;
|
||||
#endif
|
||||
}
|
||||
|
||||
return mPlatform;
|
||||
return gPlatform;
|
||||
}
|
||||
|
||||
PRBool
|
||||
gfxPlatform::UseGlitz()
|
||||
{
|
||||
#ifdef MOZ_ENABLE_GLITZ
|
||||
if (mGlitzState == -1) {
|
||||
if (gGlitzState == -1) {
|
||||
if (getenv("MOZ_GLITZ"))
|
||||
mGlitzState = 1;
|
||||
gGlitzState = 1;
|
||||
else
|
||||
mGlitzState = 0;
|
||||
gGlitzState = 0;
|
||||
}
|
||||
|
||||
if (mGlitzState)
|
||||
if (gGlitzState)
|
||||
return PR_TRUE;
|
||||
#endif
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatform::SetUseGlitz(PRBool use)
|
||||
{
|
||||
gGlitzState = (use ? 1 : 0);
|
||||
}
|
||||
|
||||
nsresult
|
||||
gfxPlatform::GetFontList(const nsACString& aLangGroup,
|
||||
const nsACString& aGenericFamily,
|
||||
|
|
Загрузка…
Ссылка в новой задаче