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

Unified Diff: src/core/SkRecords.h

Issue 473633002: SkTextBlob (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Build warnings fix. Created 6 years, 4 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/core/SkRecorder.cpp ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecords.h
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h
index 6ec6e9ca2e8485674310018e488b347062797d50..6baabe6b7655de5a8199ae5b32aa5906efc9feef 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(DrawRRect) \
M(DrawRect) \
M(DrawSprite) \
+ M(DrawTextBlob) \
M(DrawVertices)
// Defines SkRecords::Type, an enum of all record types.
@@ -231,7 +231,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,
@@ -250,6 +250,10 @@ RECORD5(DrawText, SkPaint, paint,
size_t, byteLength,
SkScalar, x,
SkScalar, y);
+RECORD4(DrawTextBlob, SkPaint, paint,
+ RefBox<SkTextBlob>, blob,
+ SkScalar, x,
+ SkScalar, y);
RECORD5(DrawTextOnPath, SkPaint, paint,
PODArray<char>, text,
size_t, byteLength,
« no previous file with comments | « src/core/SkRecorder.cpp ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698