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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/record/SkRecordDraw.h ('k') | src/record/SkRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/record/SkRecorder.h
diff --git a/src/record/SkRecorder.h b/src/record/SkRecorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..9d722b4b2bccba49df12c9b5b2d9b213ed236cb5
--- /dev/null
+++ b/src/record/SkRecorder.h
@@ -0,0 +1,70 @@
+#ifndef SkRecorder_DEFINED
+#define SkRecorder_DEFINED
+
+#include "SkCanvas.h"
+#include "SkRecord.h"
+#include "SkRecords.h"
+
+// SkRecorder provides an SkCanvas interface for recording into an SkRecord.
+
+class SkRecorder : public SkCanvas {
+public:
+ // Does not take ownership of the SkRecord.
+ SkRecorder(SkRecord*, int width, int height);
+
+ void clear(SkColor);
+ void drawPaint(const SkPaint& paint);
+ void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint);
+ void drawRect(const SkRect& rect, const SkPaint& paint);
+ void drawOval(const SkRect& oval, const SkPaint&);
+ void drawRRect(const SkRRect& rrect, const SkPaint& paint);
+ void drawPath(const SkPath& path, const SkPaint& paint);
+ void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
+ const SkPaint* paint = NULL);
+ void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
+ const SkPaint* paint = NULL,
+ DrawBitmapRectFlags flags = kNone_DrawBitmapRectFlag);
+ void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPaint* paint = NULL);
+ void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
+ const SkPaint* paint = NULL);
+ void drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint = NULL);
+ void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
+ const SkPaint& paint);
+ void drawPosText(const void* text, size_t byteLength, const SkPoint pos[],
+ const SkPaint& paint);
+ void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY,
+ const SkPaint& paint);
+ void drawTextOnPath(const void* text, size_t byteLength,
+ const SkPath& path, const SkMatrix* matrix, const SkPaint& paint);
+ void drawPicture(SkPicture& picture);
+ void drawVertices(VertexMode vmode,
+ int vertexCount, const SkPoint vertices[],
+ const SkPoint texs[], const SkColor colors[],
+ SkXfermode* xmode,
+ const uint16_t indices[], int indexCount,
+ const SkPaint& paint);
+
+ void willSave(SkCanvas::SaveFlags);
+ SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::SaveFlags);
+ void willRestore();
+
+ void didConcat(const SkMatrix&);
+ void didSetMatrix(const SkMatrix&);
+
+ void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&);
+ void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle);
+ void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle);
+ void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle);
+ void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op);
+
+private:
+ template <typename T>
+ T* copy(const T*);
+
+ template <typename T>
+ T* copy(const T[], unsigned count);
+
+ SkRecord* fRecord;
+};
+
+#endif//SkRecorder_DEFINED
« 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