aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMatrixPriv.h
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-10-20 12:14:33 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-20 16:49:57 +0000
commit6d6d603c812a6c9bb3e70157be909d355233ba6d (patch)
tree71f1700b4f93dc48d15736bc0f4eb19c458b5a19 /src/core/SkMatrixPriv.h
parent5a83f590911f30b125bc6edce01a26ac971d6e1d (diff)
make matrix serialization private
Moves readFromMemory, writeToMemory to private section. No sign that these are called from google3, android, chromium, but function names are common enough that it's hard to know for sure. These are used inside templates internally and for testing, so it is not quite as simple as adding alternate entry points in SkMatrixPriv. R=reed@google.com Bug: skia:6898 Change-Id: I1fac142f4bf0f38608ea93438c46f39147606c4d Reviewed-on: https://skia-review.googlesource.com/62361 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/core/SkMatrixPriv.h')
-rw-r--r--src/core/SkMatrixPriv.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/SkMatrixPriv.h b/src/core/SkMatrixPriv.h
index b0df2ecf9a..ed1a5f117e 100644
--- a/src/core/SkMatrixPriv.h
+++ b/src/core/SkMatrixPriv.h
@@ -13,9 +13,23 @@
class SkMatrixPriv {
public:
+ enum {
+ // writeTo/readFromMemory will never return a value larger than this
+ kMaxFlattenSize = 9 * sizeof(SkScalar) + sizeof(uint32_t),
+ };
+
+ static size_t WriteToMemory(const SkMatrix& matrix, void* buffer) {
+ return matrix.writeToMemory(buffer);
+ }
+
+ static size_t ReadFromMemory(SkMatrix* matrix, const void* buffer, size_t length) {
+ return matrix->readFromMemory(buffer, length);
+ }
+
typedef SkMatrix::MapXYProc MapXYProc;
typedef SkMatrix::MapPtsProc MapPtsProc;
+
static MapPtsProc GetMapPtsProc(const SkMatrix& matrix) {
return SkMatrix::GetMapPtsProc(matrix.getType());
}