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

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

Issue 228723003: Start on some unwritten SkRecord TODOs: (Closed) Base URL: https://skia.googlesource.com/skia.git@record-culling
Patch Set: rebase 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 | « gyp/tests.gypi ('k') | tests/RecordTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef SkRecorder_DEFINED 1 #ifndef SkRecorder_DEFINED
2 #define SkRecorder_DEFINED 2 #define SkRecorder_DEFINED
3 3
4 #include "SkCanvas.h" 4 #include "SkCanvas.h"
5 #include "SkRecord.h" 5 #include "SkRecord.h"
6 #include "SkRecords.h" 6 #include "SkRecords.h"
7 7
8 // SkRecorder provides an SkCanvas interface for recording into an SkRecord. 8 // SkRecorder provides an SkCanvas interface for recording into an SkRecord.
9 9
10 class SkRecorder : public SkCanvas { 10 class SkRecorder : public SkCanvas {
11 public: 11 public:
12 // Does not take ownership of the SkRecord. 12 // Does not take ownership of the SkRecord.
13 SkRecorder(SkRecord*, int width, int height); 13 SkRecorder(SkRecord*, int width, int height);
14 14
15 void clear(SkColor); 15 void clear(SkColor) SK_OVERRIDE;
16 void drawPaint(const SkPaint& paint); 16 void drawPaint(const SkPaint& paint) SK_OVERRIDE;
17 void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkP aint& paint); 17 void drawPoints(PointMode mode,
18 void drawRect(const SkRect& rect, const SkPaint& paint); 18 size_t count,
19 void drawOval(const SkRect& oval, const SkPaint&); 19 const SkPoint pts[],
20 void drawRRect(const SkRRect& rrect, const SkPaint& paint); 20 const SkPaint& paint) SK_OVERRIDE;
21 void drawPath(const SkPath& path, const SkPaint& paint); 21 void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
22 void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, 22 void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE;
23 const SkPaint* paint = NULL); 23 void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE;
24 void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const S kRect& dst, 24 void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
25 void drawBitmap(const SkBitmap& bitmap,
26 SkScalar left,
27 SkScalar top,
28 const SkPaint* paint = NULL) SK_OVERRIDE;
29 void drawBitmapRectToRect(const SkBitmap& bitmap,
30 const SkRect* src,
31 const SkRect& dst,
25 const SkPaint* paint = NULL, 32 const SkPaint* paint = NULL,
26 DrawBitmapRectFlags flags = kNone_DrawBitmapRectFl ag); 33 DrawBitmapRectFlags flags = kNone_DrawBitmapRectFl ag) SK_OVERRIDE;
27 void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPai nt* paint = NULL); 34 void drawBitmapMatrix(const SkBitmap& bitmap,
28 void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkR ect& dst, 35 const SkMatrix& m,
29 const SkPaint* paint = NULL); 36 const SkPaint* paint = NULL) SK_OVERRIDE;
30 void drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* pa int = NULL); 37 void drawBitmapNine(const SkBitmap& bitmap,
31 void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, 38 const SkIRect& center,
32 const SkPaint& paint); 39 const SkRect& dst,
33 void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], 40 const SkPaint* paint = NULL) SK_OVERRIDE;
34 const SkPaint& paint); 41 void drawSprite(const SkBitmap& bitmap,
35 void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[] , SkScalar constY, 42 int left,
36 const SkPaint& paint); 43 int top,
37 void drawTextOnPath(const void* text, size_t byteLength, 44 const SkPaint* paint = NULL) SK_OVERRIDE;
38 const SkPath& path, const SkMatrix* matrix, const SkPain t& paint); 45 void drawText(const void* text,
39 void drawPicture(SkPicture& picture); 46 size_t byteLength,
47 SkScalar x,
48 SkScalar y,
49 const SkPaint& paint) SK_OVERRIDE;
50 void drawPosText(const void* text,
51 size_t byteLength,
52 const SkPoint pos[],
53 const SkPaint& paint) SK_OVERRIDE;
54 void drawPosTextH(const void* text,
55 size_t byteLength,
56 const SkScalar xpos[],
57 SkScalar constY,
58 const SkPaint& paint) SK_OVERRIDE;
59 void drawTextOnPath(const void* text,
60 size_t byteLength,
61 const SkPath& path,
62 const SkMatrix* matrix,
63 const SkPaint& paint) SK_OVERRIDE;
64 void drawPicture(SkPicture& picture) SK_OVERRIDE;
40 void drawVertices(VertexMode vmode, 65 void drawVertices(VertexMode vmode,
41 int vertexCount, const SkPoint vertices[], 66 int vertexCount,
42 const SkPoint texs[], const SkColor colors[], 67 const SkPoint vertices[],
68 const SkPoint texs[],
69 const SkColor colors[],
43 SkXfermode* xmode, 70 SkXfermode* xmode,
44 const uint16_t indices[], int indexCount, 71 const uint16_t indices[],
45 const SkPaint& paint); 72 int indexCount,
73 const SkPaint& paint) SK_OVERRIDE;
46 74
47 void willSave(SkCanvas::SaveFlags); 75 void willSave(SkCanvas::SaveFlags) SK_OVERRIDE;
48 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav eFlags); 76 SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::Sav eFlags) SK_OVERRIDE;
49 void willRestore(); 77 void willRestore() SK_OVERRIDE;
50 78
51 void didConcat(const SkMatrix&); 79 void didConcat(const SkMatrix&) SK_OVERRIDE;
52 void didSetMatrix(const SkMatrix&); 80 void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
53 81
54 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); 82 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRID E;
55 void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle ); 83 void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle ) SK_OVERRIDE;
56 void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeSt yle); 84 void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeSt yle) SK_OVERRIDE;
57 void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle ); 85 void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle ) SK_OVERRIDE;
58 void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); 86 void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) SK_OVERRIDE;
59 87
60 void onPushCull(const SkRect& cullRect); 88 void onPushCull(const SkRect& cullRect) SK_OVERRIDE;
61 void onPopCull(); 89 void onPopCull() SK_OVERRIDE;
62 90
63 private: 91 private:
64 template <typename T> 92 template <typename T>
65 T* copy(const T*); 93 T* copy(const T*);
66 94
67 template <typename T> 95 template <typename T>
68 T* copy(const T[], unsigned count); 96 T* copy(const T[], unsigned count);
69 97
70 SkRecord* fRecord; 98 SkRecord* fRecord;
71 }; 99 };
72 100
73 #endif//SkRecorder_DEFINED 101 #endif//SkRecorder_DEFINED
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | tests/RecordTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698