Bug 333659. Relanding minor gfx/thebes changes --- new gfxRect APIs, new gfxSkipChars class, remove gfxContext::DrawTextRun unused method, shouldn't affect current code. r=pavlov

This commit is contained in:
roc+%cs.cmu.edu 2007-01-17 02:31:14 +00:00
Родитель 21ac4d9cfe
Коммит 0b39dca02f
4 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -22,6 +22,7 @@ EXPORTS = gfxASurface.h \
gfxPoint.h \
gfxRect.h \
gfxRegion.h \
gfxSkipChars.h \
gfxTypes.h \
gfxTextRunCache.h \
$(NULL)

Просмотреть файл

@ -51,7 +51,6 @@
#include "gfxFont.h"
class gfxRegion;
class gfxTextRun;
/**
* This is the main class for doing actual drawing. It is initialized using
@ -191,22 +190,6 @@ public:
void Ellipse(gfxPoint center, gfxSize dimensions);
void Polygon(const gfxPoint *points, PRUint32 numPoints);
/**
** Text
**/
/**
* Add the text outline to the current path.
*/
// specify this in a sane way.
//void AddStringToPath(gfxTextRun& text);
/**
* Draw the text run at the current point.
* XXX support drawing subsections of the text run
*/
void DrawTextRun(gfxTextRun *text, gfxPoint pt);
/**
** Transformation Matrix manipulation
**/

Просмотреть файл

@ -59,12 +59,25 @@ struct THEBES_API gfxRect {
return (pos != s.pos) || (size != s.size);
}
const gfxRect& MoveBy(const gfxPoint& aPt) {
pos = pos + aPt;
return *this;
}
gfxRect operator+(const gfxPoint& aPt) const {
return gfxRect(pos + aPt, size);
}
const gfxPoint& TopLeft() const { return pos; }
gfxFloat Width() const { return size.width; }
gfxFloat Height() const { return size.height; }
gfxFloat X() const { return pos.x; }
gfxFloat Y() const { return pos.y; }
gfxFloat XMost() const { return pos.x + size.width; }
gfxFloat YMost() const { return pos.y + size.height; }
PRBool IsEmpty() const { return size.width <= 0 || size.height <= 0; }
gfxRect Intersect(const gfxRect& aRect) const;
gfxRect Union(const gfxRect& aRect) const;
// XXX figure out what methods (intersect, union, etc) we use and add them.
};

Просмотреть файл

@ -26,8 +26,10 @@ CPPSRCS = \
gfxContext.cpp \
gfxImageSurface.cpp \
gfxFont.cpp \
gfxPlatform.cpp \
gfxRect.cpp \
gfxSkipChars.cpp \
gfxTextRunCache.cpp \
gfxPlatform.cpp \
$(NULL)
ifdef MOZ_TREE_CAIRO