pattern is not passed to the drawing functions anymore, it is expected to be set in SetDrawData
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12403 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -110,50 +110,40 @@ class Painter {
|
|||||||
// triangles
|
// triangles
|
||||||
void StrokeTriangle( BPoint pt1,
|
void StrokeTriangle( BPoint pt1,
|
||||||
BPoint pt2,
|
BPoint pt2,
|
||||||
BPoint pt3,
|
BPoint pt3) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillTriangle( BPoint pt1,
|
void FillTriangle( BPoint pt1,
|
||||||
BPoint pt2,
|
BPoint pt2,
|
||||||
BPoint pt3,
|
BPoint pt3) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// polygons
|
// polygons
|
||||||
void StrokePolygon( const BPoint* ptArray,
|
void StrokePolygon( const BPoint* ptArray,
|
||||||
int32 numPts,
|
int32 numPts,
|
||||||
bool closed = true,
|
bool closed = true) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillPolygon( const BPoint* ptArray,
|
void FillPolygon( const BPoint* ptArray,
|
||||||
int32 numPts,
|
int32 numPts,
|
||||||
bool closed = true,
|
bool closed = true) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// bezier curves
|
// bezier curves
|
||||||
void StrokeBezier( const BPoint* controlPoints,
|
void StrokeBezier( const BPoint* controlPoints) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillBezier( const BPoint* controlPoints,
|
void FillBezier( const BPoint* controlPoints) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// shapes
|
// shapes
|
||||||
void StrokeShape( /*const */BShape* shape,
|
void StrokeShape( /*const */BShape* shape) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillShape( /*const */BShape* shape,
|
void FillShape( /*const */BShape* shape) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
|
|
||||||
// rects
|
// rects
|
||||||
BRect StrokeRect( const BRect& r,
|
BRect StrokeRect( const BRect& r) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// strokes a one pixel wide solid rect, no blending
|
// strokes a one pixel wide solid rect, no blending
|
||||||
void StrokeRect( const BRect& r,
|
void StrokeRect( const BRect& r,
|
||||||
const rgb_color& c) const;
|
const rgb_color& c) const;
|
||||||
|
|
||||||
BRect FillRect( const BRect& r,
|
BRect FillRect( const BRect& r) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// fills a solid rect with color c, no blending
|
// fills a solid rect with color c, no blending
|
||||||
void FillRect( const BRect& r,
|
void FillRect( const BRect& r,
|
||||||
@@ -162,39 +152,33 @@ class Painter {
|
|||||||
// round rects
|
// round rects
|
||||||
void StrokeRoundRect(const BRect& r,
|
void StrokeRoundRect(const BRect& r,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillRoundRect( const BRect& r,
|
void FillRoundRect( const BRect& r,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// ellipses
|
// ellipses
|
||||||
void StrokeEllipse( BPoint center,
|
void StrokeEllipse( BPoint center,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillEllipse( BPoint center,
|
void FillEllipse( BPoint center,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// arcs
|
// arcs
|
||||||
void StrokeArc( BPoint center,
|
void StrokeArc( BPoint center,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius,
|
||||||
float angle,
|
float angle,
|
||||||
float span,
|
float span) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void FillArc( BPoint center,
|
void FillArc( BPoint center,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius,
|
||||||
float angle,
|
float angle,
|
||||||
float span,
|
float span) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
// strings
|
// strings
|
||||||
BRect DrawChar( char aChar);
|
BRect DrawChar( char aChar);
|
||||||
@@ -228,8 +212,7 @@ class Painter {
|
|||||||
BRect viewRect) const;
|
BRect viewRect) const;
|
||||||
|
|
||||||
// some convenience stuff
|
// some convenience stuff
|
||||||
void FillRegion( const BRegion* region,
|
void FillRegion( const BRegion* region) const;
|
||||||
const pattern& p = B_SOLID_HIGH) const;
|
|
||||||
|
|
||||||
void InvertRect( const BRect& r) const;
|
void InvertRect( const BRect& r) const;
|
||||||
|
|
||||||
@@ -258,20 +241,16 @@ class Painter {
|
|||||||
void _DrawTriangle( BPoint pt1,
|
void _DrawTriangle( BPoint pt1,
|
||||||
BPoint pt2,
|
BPoint pt2,
|
||||||
BPoint pt3,
|
BPoint pt3,
|
||||||
const pattern& p,
|
|
||||||
bool fill) const;
|
bool fill) const;
|
||||||
void _DrawEllipse( BPoint center,
|
void _DrawEllipse( BPoint center,
|
||||||
float xRadius,
|
float xRadius,
|
||||||
float yRadius,
|
float yRadius,
|
||||||
const pattern& p,
|
|
||||||
bool fill) const;
|
bool fill) const;
|
||||||
void _DrawShape( /*const */BShape* shape,
|
void _DrawShape( /*const */BShape* shape,
|
||||||
const pattern& p,
|
|
||||||
bool fill) const;
|
bool fill) const;
|
||||||
void _DrawPolygon( const BPoint* ptArray,
|
void _DrawPolygon( const BPoint* ptArray,
|
||||||
int32 numPts,
|
int32 numPts,
|
||||||
bool closed,
|
bool closed,
|
||||||
const pattern& p,
|
|
||||||
bool fill) const;
|
bool fill) const;
|
||||||
|
|
||||||
void _DrawBitmap( const agg::rendering_buffer& srcBuffer,
|
void _DrawBitmap( const agg::rendering_buffer& srcBuffer,
|
||||||
@@ -291,12 +270,9 @@ class Painter {
|
|||||||
BRect _BoundingBox(VertexSource& path) const;
|
BRect _BoundingBox(VertexSource& path) const;
|
||||||
|
|
||||||
template<class VertexSource>
|
template<class VertexSource>
|
||||||
BRect _StrokePath(VertexSource& path,
|
BRect _StrokePath(VertexSource& path) const;
|
||||||
const pattern& p) const;
|
|
||||||
template<class VertexSource>
|
template<class VertexSource>
|
||||||
BRect _FillPath(VertexSource& path,
|
BRect _FillPath(VertexSource& path) const;
|
||||||
|
|
||||||
const pattern& p) const;
|
|
||||||
|
|
||||||
void _SetPattern(const pattern& p) const;
|
void _SetPattern(const pattern& p) const;
|
||||||
void _SetRendererColor(const rgb_color& color) const;
|
void _SetRendererColor(const rgb_color& color) const;
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ Painter::StrokeLine(BPoint a, BPoint b, DrawData* context)
|
|||||||
path.move_to(a.x, a.y);
|
path.move_to(a.x, a.y);
|
||||||
path.line_to(b.x, b.y);
|
path.line_to(b.x, b.y);
|
||||||
|
|
||||||
touched = _StrokePath(path, *fPatternHandler->GetR5Pattern());
|
touched = _StrokePath(path);
|
||||||
|
|
||||||
return _Clipped(touched);
|
return _Clipped(touched);
|
||||||
}
|
}
|
||||||
@@ -401,37 +401,37 @@ Painter::StraightLine(BPoint a, BPoint b, const rgb_color& c) const
|
|||||||
|
|
||||||
// StrokeTriangle
|
// StrokeTriangle
|
||||||
void
|
void
|
||||||
Painter::StrokeTriangle(BPoint pt1, BPoint pt2, BPoint pt3, const pattern& p) const
|
Painter::StrokeTriangle(BPoint pt1, BPoint pt2, BPoint pt3) const
|
||||||
{
|
{
|
||||||
_DrawTriangle(pt1, pt2, pt3, p, false);
|
_DrawTriangle(pt1, pt2, pt3, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillTriangle
|
// FillTriangle
|
||||||
void
|
void
|
||||||
Painter::FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3, const pattern& p) const
|
Painter::FillTriangle(BPoint pt1, BPoint pt2, BPoint pt3) const
|
||||||
{
|
{
|
||||||
_DrawTriangle(pt1, pt2, pt3, p, true);
|
_DrawTriangle(pt1, pt2, pt3, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokePolygon
|
// StrokePolygon
|
||||||
void
|
void
|
||||||
Painter::StrokePolygon(const BPoint* ptArray, int32 numPts,
|
Painter::StrokePolygon(const BPoint* ptArray, int32 numPts,
|
||||||
bool closed, const pattern& p) const
|
bool closed) const
|
||||||
{
|
{
|
||||||
_DrawPolygon(ptArray, numPts, closed, p, false);
|
_DrawPolygon(ptArray, numPts, closed, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillPolygon
|
// FillPolygon
|
||||||
void
|
void
|
||||||
Painter::FillPolygon(const BPoint* ptArray, int32 numPts,
|
Painter::FillPolygon(const BPoint* ptArray, int32 numPts,
|
||||||
bool closed, const pattern& p) const
|
bool closed) const
|
||||||
{
|
{
|
||||||
_DrawPolygon(ptArray, numPts, closed, p, true);
|
_DrawPolygon(ptArray, numPts, closed, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokeBezier
|
// StrokeBezier
|
||||||
void
|
void
|
||||||
Painter::StrokeBezier(const BPoint* controlPoints, const pattern& p) const
|
Painter::StrokeBezier(const BPoint* controlPoints) const
|
||||||
{
|
{
|
||||||
agg::path_storage curve;
|
agg::path_storage curve;
|
||||||
|
|
||||||
@@ -452,12 +452,12 @@ Painter::StrokeBezier(const BPoint* controlPoints, const pattern& p) const
|
|||||||
|
|
||||||
agg::conv_curve<agg::path_storage> path(curve);
|
agg::conv_curve<agg::path_storage> path(curve);
|
||||||
|
|
||||||
_StrokePath(path, p);
|
_StrokePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillBezier
|
// FillBezier
|
||||||
void
|
void
|
||||||
Painter::FillBezier(const BPoint* controlPoints, const pattern& p) const
|
Painter::FillBezier(const BPoint* controlPoints) const
|
||||||
{
|
{
|
||||||
agg::path_storage curve;
|
agg::path_storage curve;
|
||||||
|
|
||||||
@@ -478,26 +478,26 @@ Painter::FillBezier(const BPoint* controlPoints, const pattern& p) const
|
|||||||
|
|
||||||
agg::conv_curve<agg::path_storage> path(curve);
|
agg::conv_curve<agg::path_storage> path(curve);
|
||||||
|
|
||||||
_FillPath(path, p);
|
_FillPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokeShape
|
// StrokeShape
|
||||||
void
|
void
|
||||||
Painter::StrokeShape(/*const */BShape* shape, const pattern& p) const
|
Painter::StrokeShape(/*const */BShape* shape) const
|
||||||
{
|
{
|
||||||
_DrawShape(shape, p, false);
|
_DrawShape(shape, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillShape
|
// FillShape
|
||||||
void
|
void
|
||||||
Painter::FillShape(/*const */BShape* shape, const pattern& p) const
|
Painter::FillShape(/*const */BShape* shape) const
|
||||||
{
|
{
|
||||||
_DrawShape(shape, p, true);
|
_DrawShape(shape, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokeRect
|
// StrokeRect
|
||||||
BRect
|
BRect
|
||||||
Painter::StrokeRect(const BRect& r, const pattern& p) const
|
Painter::StrokeRect(const BRect& r) const
|
||||||
{
|
{
|
||||||
BPoint a(r.left, r.top);
|
BPoint a(r.left, r.top);
|
||||||
BPoint b(r.right, r.bottom);
|
BPoint b(r.right, r.bottom);
|
||||||
@@ -507,8 +507,7 @@ Painter::StrokeRect(const BRect& r, const pattern& p) const
|
|||||||
// first, try an optimized version
|
// first, try an optimized version
|
||||||
if (fPenSize == 1.0 &&
|
if (fPenSize == 1.0 &&
|
||||||
(fDrawingMode == B_OP_COPY || fDrawingMode == B_OP_OVER)) {
|
(fDrawingMode == B_OP_COPY || fDrawingMode == B_OP_OVER)) {
|
||||||
// TODO: fix me
|
pattern p = *fPatternHandler->GetR5Pattern();
|
||||||
// pattern p = *fPatternHandler->GetR5Pattern();
|
|
||||||
if (p == B_SOLID_HIGH) {
|
if (p == B_SOLID_HIGH) {
|
||||||
BRect rect(a, b);
|
BRect rect(a, b);
|
||||||
StrokeRect(rect,
|
StrokeRect(rect,
|
||||||
@@ -529,7 +528,7 @@ Painter::StrokeRect(const BRect& r, const pattern& p) const
|
|||||||
path.line_to(a.x, b.y);
|
path.line_to(a.x, b.y);
|
||||||
path.close_polygon();
|
path.close_polygon();
|
||||||
|
|
||||||
return _StrokePath(path, p);
|
return _StrokePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokeRect
|
// StrokeRect
|
||||||
@@ -548,7 +547,7 @@ Painter::StrokeRect(const BRect& r, const rgb_color& c) const
|
|||||||
|
|
||||||
// FillRect
|
// FillRect
|
||||||
BRect
|
BRect
|
||||||
Painter::FillRect(const BRect& r, const pattern& p) const
|
Painter::FillRect(const BRect& r) const
|
||||||
{
|
{
|
||||||
BPoint a(r.left, r.top);
|
BPoint a(r.left, r.top);
|
||||||
BPoint b(r.right, r.bottom);
|
BPoint b(r.right, r.bottom);
|
||||||
@@ -557,12 +556,12 @@ Painter::FillRect(const BRect& r, const pattern& p) const
|
|||||||
|
|
||||||
// first, try an optimized version
|
// first, try an optimized version
|
||||||
if (fDrawingMode == B_OP_COPY || fDrawingMode == B_OP_OVER) {
|
if (fDrawingMode == B_OP_COPY || fDrawingMode == B_OP_OVER) {
|
||||||
pattern pat = *fPatternHandler->GetR5Pattern();
|
pattern p = *fPatternHandler->GetR5Pattern();
|
||||||
if (pat == B_SOLID_HIGH) {
|
if (p == B_SOLID_HIGH) {
|
||||||
BRect rect(a, b);
|
BRect rect(a, b);
|
||||||
FillRect(rect, fPatternHandler->HighColor().GetColor32());
|
FillRect(rect, fPatternHandler->HighColor().GetColor32());
|
||||||
return _Clipped(rect);
|
return _Clipped(rect);
|
||||||
} else if (pat == B_SOLID_LOW) {
|
} else if (p == B_SOLID_LOW) {
|
||||||
BRect rect(a, b);
|
BRect rect(a, b);
|
||||||
FillRect(rect, fPatternHandler->LowColor().GetColor32());
|
FillRect(rect, fPatternHandler->LowColor().GetColor32());
|
||||||
return _Clipped(rect);
|
return _Clipped(rect);
|
||||||
@@ -582,7 +581,7 @@ Painter::FillRect(const BRect& r, const pattern& p) const
|
|||||||
path.line_to(a.x, b.y);
|
path.line_to(a.x, b.y);
|
||||||
path.close_polygon();
|
path.close_polygon();
|
||||||
|
|
||||||
return _FillPath(path, p);
|
return _FillPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillRect
|
// FillRect
|
||||||
@@ -621,8 +620,7 @@ Painter::FillRect(const BRect& r, const rgb_color& c) const
|
|||||||
|
|
||||||
// StrokeRoundRect
|
// StrokeRoundRect
|
||||||
void
|
void
|
||||||
Painter::StrokeRoundRect(const BRect& r, float xRadius, float yRadius,
|
Painter::StrokeRoundRect(const BRect& r, float xRadius, float yRadius) const
|
||||||
const pattern& p) const
|
|
||||||
{
|
{
|
||||||
BPoint lt(r.left, r.top);
|
BPoint lt(r.left, r.top);
|
||||||
BPoint rb(r.right, r.bottom);
|
BPoint rb(r.right, r.bottom);
|
||||||
@@ -633,13 +631,12 @@ Painter::StrokeRoundRect(const BRect& r, float xRadius, float yRadius,
|
|||||||
rect.rect(lt.x, lt.y, rb.x, rb.y);
|
rect.rect(lt.x, lt.y, rb.x, rb.y);
|
||||||
rect.radius(xRadius, yRadius);
|
rect.radius(xRadius, yRadius);
|
||||||
|
|
||||||
_StrokePath(rect, p);
|
_StrokePath(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillRoundRect
|
// FillRoundRect
|
||||||
void
|
void
|
||||||
Painter::FillRoundRect(const BRect& r, float xRadius, float yRadius,
|
Painter::FillRoundRect(const BRect& r, float xRadius, float yRadius) const
|
||||||
const pattern& p) const
|
|
||||||
{
|
{
|
||||||
BPoint lt(r.left, r.top);
|
BPoint lt(r.left, r.top);
|
||||||
BPoint rb(r.right, r.bottom);
|
BPoint rb(r.right, r.bottom);
|
||||||
@@ -656,29 +653,27 @@ Painter::FillRoundRect(const BRect& r, float xRadius, float yRadius,
|
|||||||
rect.rect(lt.x, lt.y, rb.x, rb.y);
|
rect.rect(lt.x, lt.y, rb.x, rb.y);
|
||||||
rect.radius(xRadius, yRadius);
|
rect.radius(xRadius, yRadius);
|
||||||
|
|
||||||
_FillPath(rect, p);
|
_FillPath(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokeEllipse
|
// StrokeEllipse
|
||||||
void
|
void
|
||||||
Painter::StrokeEllipse(BPoint center, float xRadius, float yRadius,
|
Painter::StrokeEllipse(BPoint center, float xRadius, float yRadius) const
|
||||||
const pattern& p) const
|
|
||||||
{
|
{
|
||||||
_DrawEllipse(center, xRadius, yRadius, p, false);
|
_DrawEllipse(center, xRadius, yRadius, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillEllipse
|
// FillEllipse
|
||||||
void
|
void
|
||||||
Painter::FillEllipse(BPoint center, float xRadius, float yRadius,
|
Painter::FillEllipse(BPoint center, float xRadius, float yRadius) const
|
||||||
const pattern& p) const
|
|
||||||
{
|
{
|
||||||
_DrawEllipse(center, xRadius, yRadius, p, true);
|
_DrawEllipse(center, xRadius, yRadius, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// StrokeArc
|
// StrokeArc
|
||||||
void
|
void
|
||||||
Painter::StrokeArc(BPoint center, float xRadius, float yRadius,
|
Painter::StrokeArc(BPoint center, float xRadius, float yRadius,
|
||||||
float angle, float span, const pattern& p) const
|
float angle, float span) const
|
||||||
{
|
{
|
||||||
_Transform(¢er);
|
_Transform(¢er);
|
||||||
|
|
||||||
@@ -689,13 +684,13 @@ Painter::StrokeArc(BPoint center, float xRadius, float yRadius,
|
|||||||
|
|
||||||
agg::conv_curve<agg::bezier_arc> path(arc);
|
agg::conv_curve<agg::bezier_arc> path(arc);
|
||||||
|
|
||||||
_StrokePath(path, p);
|
_StrokePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FillArc
|
// FillArc
|
||||||
void
|
void
|
||||||
Painter::FillArc(BPoint center, float xRadius, float yRadius,
|
Painter::FillArc(BPoint center, float xRadius, float yRadius,
|
||||||
float angle, float span, const pattern& p) const
|
float angle, float span) const
|
||||||
{
|
{
|
||||||
_Transform(¢er);
|
_Transform(¢er);
|
||||||
|
|
||||||
@@ -723,7 +718,7 @@ Painter::FillArc(BPoint center, float xRadius, float yRadius,
|
|||||||
|
|
||||||
path.close_polygon();
|
path.close_polygon();
|
||||||
|
|
||||||
_FillPath(path, p);
|
_FillPath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
@@ -851,12 +846,12 @@ Painter::DrawBitmap(const ServerBitmap* bitmap,
|
|||||||
|
|
||||||
// FillRegion
|
// FillRegion
|
||||||
void
|
void
|
||||||
Painter::FillRegion(const BRegion* region, const pattern& p = B_SOLID_HIGH) const
|
Painter::FillRegion(const BRegion* region) const
|
||||||
{
|
{
|
||||||
BRegion copy(*region);
|
BRegion copy(*region);
|
||||||
int32 count = copy.CountRects();
|
int32 count = copy.CountRects();
|
||||||
for (int32 i = 0; i < count; i++) {
|
for (int32 i = 0; i < count; i++) {
|
||||||
FillRect(copy.RectAt(i), p);
|
FillRect(copy.RectAt(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1038,8 +1033,7 @@ Painter::_UpdateLineWidth()
|
|||||||
|
|
||||||
// _DrawTriangle
|
// _DrawTriangle
|
||||||
inline void
|
inline void
|
||||||
Painter::_DrawTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
|
Painter::_DrawTriangle(BPoint pt1, BPoint pt2, BPoint pt3, bool fill) const
|
||||||
const pattern& p, bool fill) const
|
|
||||||
{
|
{
|
||||||
_Transform(&pt1);
|
_Transform(&pt1);
|
||||||
_Transform(&pt2);
|
_Transform(&pt2);
|
||||||
@@ -1054,15 +1048,15 @@ Painter::_DrawTriangle(BPoint pt1, BPoint pt2, BPoint pt3,
|
|||||||
path.close_polygon();
|
path.close_polygon();
|
||||||
|
|
||||||
if (fill)
|
if (fill)
|
||||||
_FillPath(path, p);
|
_FillPath(path);
|
||||||
else
|
else
|
||||||
_StrokePath(path, p);
|
_StrokePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _DrawEllipse
|
// _DrawEllipse
|
||||||
inline void
|
inline void
|
||||||
Painter::_DrawEllipse(BPoint center, float xRadius, float yRadius,
|
Painter::_DrawEllipse(BPoint center, float xRadius, float yRadius,
|
||||||
const pattern& p, bool fill) const
|
bool fill) const
|
||||||
{
|
{
|
||||||
// TODO: I think the conversion and the offset of
|
// TODO: I think the conversion and the offset of
|
||||||
// pixel centers might not be correct here, and it
|
// pixel centers might not be correct here, and it
|
||||||
@@ -1075,14 +1069,14 @@ Painter::_DrawEllipse(BPoint center, float xRadius, float yRadius,
|
|||||||
agg::ellipse path(center.x, center.y, xRadius, yRadius, divisions);
|
agg::ellipse path(center.x, center.y, xRadius, yRadius, divisions);
|
||||||
|
|
||||||
if (fill)
|
if (fill)
|
||||||
_FillPath(path, p);
|
_FillPath(path);
|
||||||
else
|
else
|
||||||
_StrokePath(path, p);
|
_StrokePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _DrawShape
|
// _DrawShape
|
||||||
inline void
|
inline void
|
||||||
Painter::_DrawShape(/*const */BShape* shape, const pattern& p, bool fill) const
|
Painter::_DrawShape(/*const */BShape* shape, bool fill) const
|
||||||
{
|
{
|
||||||
// TODO: untested
|
// TODO: untested
|
||||||
agg::path_storage path;
|
agg::path_storage path;
|
||||||
@@ -1094,15 +1088,15 @@ Painter::_DrawShape(/*const */BShape* shape, const pattern& p, bool fill) const
|
|||||||
converter.Iterate(shape);
|
converter.Iterate(shape);
|
||||||
|
|
||||||
if (fill)
|
if (fill)
|
||||||
_FillPath(path, p);
|
_FillPath(path);
|
||||||
else
|
else
|
||||||
_StrokePath(path, p);
|
_StrokePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _DrawPolygon
|
// _DrawPolygon
|
||||||
inline void
|
inline void
|
||||||
Painter::_DrawPolygon(const BPoint* ptArray, int32 numPts,
|
Painter::_DrawPolygon(const BPoint* ptArray, int32 numPts,
|
||||||
bool closed, const pattern& p, bool fill) const
|
bool closed, bool fill) const
|
||||||
{
|
{
|
||||||
if (numPts > 0) {
|
if (numPts > 0) {
|
||||||
|
|
||||||
@@ -1120,9 +1114,9 @@ Painter::_DrawPolygon(const BPoint* ptArray, int32 numPts,
|
|||||||
path.close_polygon();
|
path.close_polygon();
|
||||||
|
|
||||||
if (fill)
|
if (fill)
|
||||||
_FillPath(path, p);
|
_FillPath(path);
|
||||||
else
|
else
|
||||||
_StrokePath(path, p);
|
_StrokePath(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1287,13 +1281,8 @@ Painter::_BoundingBox(VertexSource& path) const
|
|||||||
// _StrokePath
|
// _StrokePath
|
||||||
template<class VertexSource>
|
template<class VertexSource>
|
||||||
BRect
|
BRect
|
||||||
Painter::_StrokePath(VertexSource& path, const pattern& p) const
|
Painter::_StrokePath(VertexSource& path) const
|
||||||
{
|
{
|
||||||
// We're now used by app_server and SetDrawData() was called prior to
|
|
||||||
// this and it means the pattern is already set
|
|
||||||
// fPatternHandler->SetPattern(p);
|
|
||||||
// _SetPattern(p);
|
|
||||||
|
|
||||||
#if ALIASED_DRAWING
|
#if ALIASED_DRAWING
|
||||||
if (fPenSize > 1.0) {
|
if (fPenSize > 1.0) {
|
||||||
agg::conv_stroke<VertexSource> stroke(path);
|
agg::conv_stroke<VertexSource> stroke(path);
|
||||||
@@ -1314,13 +1303,8 @@ Painter::_StrokePath(VertexSource& path, const pattern& p) const
|
|||||||
// _FillPath
|
// _FillPath
|
||||||
template<class VertexSource>
|
template<class VertexSource>
|
||||||
BRect
|
BRect
|
||||||
Painter::_FillPath(VertexSource& path, const pattern& p) const
|
Painter::_FillPath(VertexSource& path) const
|
||||||
{
|
{
|
||||||
// We're now used by app_server and SetDrawData() was called prior to
|
|
||||||
// this and it means the pattern is already set
|
|
||||||
// fPatternHandler->SetPattern(p);
|
|
||||||
// _SetPattern(p);
|
|
||||||
|
|
||||||
fRasterizer->add_path(path);
|
fRasterizer->add_path(path);
|
||||||
agg::render_scanlines(*fRasterizer, *fScanline, *fRenderer);
|
agg::render_scanlines(*fRasterizer, *fScanline, *fRenderer);
|
||||||
|
|
||||||
@@ -1331,6 +1315,9 @@ Painter::_FillPath(VertexSource& path, const pattern& p) const
|
|||||||
void
|
void
|
||||||
Painter::_SetPattern(const pattern& p) const
|
Painter::_SetPattern(const pattern& p) const
|
||||||
{
|
{
|
||||||
|
// TODO: currently unused, purpose is to construct
|
||||||
|
// special drawing mode instances that work on solid patterns
|
||||||
|
// currently, there is only such a thing for B_OP_COPY
|
||||||
if (!(p == *fPatternHandler->GetR5Pattern())) {
|
if (!(p == *fPatternHandler->GetR5Pattern())) {
|
||||||
printf("Painter::_SetPattern()\n");
|
printf("Painter::_SetPattern()\n");
|
||||||
fPatternHandler->SetPattern(p);
|
fPatternHandler->SetPattern(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user