00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SkCullPoints_DEFINED
00018 #define SkCullPoints_DEFINED
00019
00020 #include "SkRect.h"
00021
00022 class SkCullPoints {
00023 public:
00024 SkCullPoints();
00025 SkCullPoints(const SkIRect& r);
00026
00027 void reset(const SkIRect& r);
00028
00031 void moveTo(int x, int y);
00032
00033 enum LineToResult {
00034 kNo_Result,
00035 kLineTo_Result,
00036 kMoveToLineTo_Result
00037 };
00040 LineToResult lineTo(int x, int y, SkIPoint pts[2]);
00041
00042 private:
00043 SkIRect fR;
00044 SkIPoint fAsQuad[4];
00045 SkIPoint fPrevPt;
00046 LineToResult fPrevResult;
00047
00048 bool sect_test(int x0, int y0, int x1, int y1) const;
00049 };
00050
00052
00053 class SkPath;
00054
00060 class SkCullPointsPath {
00061 public:
00062 SkCullPointsPath();
00063 SkCullPointsPath(const SkIRect& r, SkPath* dst);
00064
00065 void reset(const SkIRect& r, SkPath* dst);
00066
00067 void moveTo(int x, int y);
00068 void lineTo(int x, int y);
00069
00070 private:
00071 SkCullPoints fCP;
00072 SkPath* fPath;
00073 };
00074
00075 #endif