зеркало из https://github.com/mozilla/gecko-dev.git
notpartofthebuild thebes fixes to my fixes, since merging is hard.
This commit is contained in:
Родитель
380e5a443f
Коммит
eb6f78a4d3
|
@ -47,13 +47,12 @@ MODULE = gfx
|
|||
ifdef MOZ_TREE_CAIRO
|
||||
DIRS = cairo
|
||||
endif
|
||||
|
||||
DIRS += public idl src
|
||||
|
||||
ifdef MOZ_ENABLE_CAIRO_GFX
|
||||
DIRS += thebes
|
||||
endif
|
||||
|
||||
DIRS += public idl src
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
TOOL_DIRS += tests
|
||||
endif
|
||||
|
|
|
@ -27,7 +27,7 @@ EXPORTS += gfxWindowsSurface.h
|
|||
endif
|
||||
|
||||
ifeq ($(MOZ_GFX_TOOLKIT),gtk2)
|
||||
EXPORTS += gfxXlibSurface.h
|
||||
EXPORTS += gfxXlibSurface.h
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -50,14 +50,11 @@ public:
|
|||
cairo_surface_t* CairoSurface() { return mSurface; }
|
||||
|
||||
protected:
|
||||
cairo_surface_t* mSurface;
|
||||
|
||||
void Init(cairo_surface_t* surface) {
|
||||
mDestroyed = PR_FALSE;
|
||||
mSurface = surface;
|
||||
}
|
||||
|
||||
PRBool mDestroyed;
|
||||
void Destroy() {
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Calling Destroy on an already-destroyed surface!");
|
||||
|
@ -68,11 +65,18 @@ protected:
|
|||
mDestroyed = PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool Destroyed() {
|
||||
return mDestroyed;
|
||||
}
|
||||
|
||||
virtual ~gfxASurface() {
|
||||
if (!mDestroyed) {
|
||||
NS_WARNING("gfxASurface::~gfxASurface called, but cairo surface was not destroyed! (Did someone forget to call Destroy()?)");
|
||||
}
|
||||
}
|
||||
private:
|
||||
cairo_surface_t* mSurface;
|
||||
PRBool mDestroyed;
|
||||
};
|
||||
|
||||
#endif /* GFX_ASURFACE_H */
|
||||
|
|
|
@ -92,12 +92,6 @@ struct gfxPoint {
|
|||
gfxPoint operator-(const gfxSize& s) const {
|
||||
return gfxPoint(x - s.width, y - s.height);
|
||||
}
|
||||
gfxPoint operator-(const gfxPoint& p) const {
|
||||
return gfxPoint(x - p.x, y - p.y);
|
||||
}
|
||||
gfxPoint operator-(const gfxSize& s) const {
|
||||
return gfxPoint(x - s.width, y - s.height);
|
||||
}
|
||||
gfxPoint operator-() const {
|
||||
return gfxPoint(- x, - y);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ gfxXlibSurface::gfxXlibSurface(Display* dpy, Visual* visual, unsigned long width
|
|||
width, height,
|
||||
DefaultDepth(dpy, DefaultScreen(dpy)));
|
||||
|
||||
cairo_surface_t *surf = cairo_xlib_surface_create(dpy, pixmap, visual, width, height);
|
||||
cairo_surface_t *surf = cairo_xlib_surface_create(dpy, mDrawable, visual, width, height);
|
||||
Init(surf);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче