Index: src/core/SkRecords.h |
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h |
index 1efdf28b14048667d2336e22519d0c502ab91ba6..dd089a84bfadef2712a46ad15473dc824f2faab1 100644 |
--- a/src/core/SkRecords.h |
+++ b/src/core/SkRecords.h |
@@ -10,23 +10,22 @@ |
#include "SkCanvas.h" |
#include "SkPicture.h" |
+#include "SkTextBlob.h" |
-class SkPictureBox { |
+namespace SkRecords { |
+ |
+template <typename T> |
+class RefBox: SkNoncopyable { |
public: |
- SkPictureBox(const SkPicture* obj) : fObj(SkRef(obj)) {} |
- ~SkPictureBox() { fObj->unref(); } |
+ RefBox(const T* obj) : fObj(SkRef(obj)) {} |
+ ~RefBox() { fObj->unref(); } |
- operator const SkPicture*() const { return fObj; } |
+ operator const T*() const { return fObj; } |
private: |
- SkPictureBox(const SkPictureBox&); |
- SkPictureBox& operator=(const SkPictureBox&); |
- |
- const SkPicture* fObj; |
+ const T* fObj; |
}; |
-namespace SkRecords { |
- |
// A list of all the types of canvas calls we can record. |
// Each of these is reified into a struct below. |
// |
@@ -68,6 +67,7 @@ namespace SkRecords { |
M(DrawRect) \ |
M(DrawSprite) \ |
M(DrawText) \ |
+ M(DrawTextBlob) \ |
M(DrawTextOnPath) \ |
M(DrawVertices) |
@@ -233,7 +233,7 @@ RECORD2(DrawOval, SkPaint, paint, SkRect, oval); |
RECORD1(DrawPaint, SkPaint, paint); |
RECORD2(DrawPath, SkPaint, paint, SkPath, path); |
//RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch); |
-RECORD3(DrawPicture, Optional<SkPaint>, paint, SkPictureBox, picture, Optional<SkMatrix>, matrix); |
+RECORD3(DrawPicture, Optional<SkPaint>, paint, RefBox<SkPicture>, picture, Optional<SkMatrix>, matrix); |
RECORD4(DrawPoints, SkPaint, paint, SkCanvas::PointMode, mode, size_t, count, SkPoint*, pts); |
RECORD4(DrawPosText, SkPaint, paint, |
PODArray<char>, text, |
@@ -257,6 +257,9 @@ RECORD5(DrawTextOnPath, SkPaint, paint, |
size_t, byteLength, |
SkPath, path, |
Optional<SkMatrix>, matrix); |
+RECORD3(DrawTextBlob, SkPaint, paint, |
+ SkPoint, offset, |
+ RefBox<SkTextBlob>, blob); |
// This guy is so ugly we just write it manually. |
struct DrawVertices { |