Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/record/SkRecorder.h

Issue 206313003: SkRecord strawman (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: IsSmall -> IsLarge: pithier Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/record/SkRecordDraw.h ('k') | src/record/SkRecorder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « src/record/SkRecordDraw.h ('k') | src/record/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698