OLD | NEW |
(Empty) | |
| 1 #ifndef SkRecorder_DEFINED |
| 2 #define SkRecorder_DEFINED |
| 3 |
| 4 #include "SkCanvas.h" |
| 5 #include "SkRecord.h" |
| 6 #include "SkRecords.h" |
| 7 |
| 8 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. |
| 9 |
| 10 class SkRecorder : public SkCanvas { |
| 11 public: |
| 12 // Does not take ownership of the SkRecord. |
| 13 SkRecorder(SkRecord*, int width, int height); |
| 14 |
| 15 void clear(SkColor); |
| 16 void drawPaint(const SkPaint& paint); |
| 17 void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkP
aint& paint); |
| 18 void drawRect(const SkRect& rect, const SkPaint& paint); |
| 19 void drawOval(const SkRect& oval, const SkPaint&); |
| 20 void drawRRect(const SkRRect& rrect, const SkPaint& paint); |
| 21 void drawPath(const SkPath& path, const SkPaint& paint); |
| 22 void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
| 23 const SkPaint* paint = NULL); |
| 24 void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const S
kRect& dst, |
| 25 const SkPaint* paint = NULL, |
| 26 DrawBitmapRectFlags flags = kNone_DrawBitmapRectFl
ag); |
| 27 void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPai
nt* paint = NULL); |
| 28 void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkR
ect& dst, |
| 29 const SkPaint* paint = NULL); |
| 30 void drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* pa
int = NULL); |
| 31 void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, |
| 32 const SkPaint& paint); |
| 33 void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], |
| 34 const SkPaint& paint); |
| 35 void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[]
, SkScalar constY, |
| 36 const SkPaint& paint); |
| 37 void drawTextOnPath(const void* text, size_t byteLength, |
| 38 const SkPath& path, const SkMatrix* matrix, const SkPain
t& paint); |
| 39 void drawPicture(SkPicture& picture); |
| 40 void drawVertices(VertexMode vmode, |
| 41 int vertexCount, const SkPoint vertices[], |
| 42 const SkPoint texs[], const SkColor colors[], |
| 43 SkXfermode* xmode, |
| 44 const uint16_t indices[], int indexCount, |
| 45 const SkPaint& paint); |
| 46 |
| 47 void willSave(SkCanvas::SaveFlags); |
| 48 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav
eFlags); |
| 49 void willRestore(); |
| 50 |
| 51 void didConcat(const SkMatrix&); |
| 52 void didSetMatrix(const SkMatrix&); |
| 53 |
| 54 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); |
| 55 void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle
); |
| 56 void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeSt
yle); |
| 57 void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle
); |
| 58 void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); |
| 59 |
| 60 private: |
| 61 template <typename T> |
| 62 T* copy(const T*); |
| 63 |
| 64 template <typename T> |
| 65 T* copy(const T[], unsigned count); |
| 66 |
| 67 SkRecord* fRecord; |
| 68 }; |
| 69 |
| 70 #endif//SkRecorder_DEFINED |
OLD | NEW |