diff options
author | 2017-10-20 12:14:33 -0400 | |
---|---|---|
committer | 2017-10-20 16:49:57 +0000 | |
commit | 6d6d603c812a6c9bb3e70157be909d355233ba6d (patch) | |
tree | 71f1700b4f93dc48d15736bc0f4eb19c458b5a19 /src/core/SkPictureRecord.cpp | |
parent | 5a83f590911f30b125bc6edce01a26ac971d6e1d (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/SkPictureRecord.cpp')
-rw-r--r-- | src/core/SkPictureRecord.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index 2ebe7bbe50..3700e3b330 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -8,6 +8,7 @@ #include "SkPictureRecord.h" #include "SkDrawShadowInfo.h" #include "SkImage_Base.h" +#include "SkMatrixPriv.h" #include "SkPatchUtils.h" #include "SkPixelRef.h" #include "SkRRect.h" @@ -111,7 +112,7 @@ void SkPictureRecord::recordSaveLayer(const SaveLayerRec& rec) { } if (rec.fClipMatrix) { flatFlags |= SAVELAYERREC_HAS_CLIPMATRIX; - size += rec.fClipMatrix->writeToMemory(nullptr); + size += SkMatrixPriv::WriteToMemory(*rec.fClipMatrix, nullptr); } const size_t initialOffset = this->addDraw(SAVE_LAYER_SAVELAYERREC, &size); @@ -225,7 +226,7 @@ void SkPictureRecord::didConcat(const SkMatrix& matrix) { void SkPictureRecord::recordConcat(const SkMatrix& matrix) { this->validate(fWriter.bytesWritten(), 0); // op + matrix - size_t size = kUInt32Size + matrix.writeToMemory(nullptr); + size_t size = kUInt32Size + SkMatrixPriv::WriteToMemory(matrix, nullptr); size_t initialOffset = this->addDraw(CONCAT, &size); this->addMatrix(matrix); this->validate(initialOffset, size); @@ -234,7 +235,7 @@ void SkPictureRecord::recordConcat(const SkMatrix& matrix) { void SkPictureRecord::didSetMatrix(const SkMatrix& matrix) { this->validate(fWriter.bytesWritten(), 0); // op + matrix - size_t size = kUInt32Size + matrix.writeToMemory(nullptr); + size_t size = kUInt32Size + SkMatrixPriv::WriteToMemory(matrix, nullptr); size_t initialOffset = this->addDraw(SET_MATRIX, &size); this->addMatrix(matrix); this->validate(initialOffset, size); @@ -623,7 +624,8 @@ void SkPictureRecord::onDrawTextOnPath(const void* text, size_t byteLength, cons const SkMatrix* matrix, const SkPaint& paint) { // op + paint index + length + 'length' worth of data + path index + matrix const SkMatrix& m = matrix ? *matrix : SkMatrix::I(); - size_t size = 3 * kUInt32Size + SkAlign4(byteLength) + kUInt32Size + m.writeToMemory(nullptr); + size_t size = 3 * kUInt32Size + SkAlign4(byteLength) + kUInt32Size + + SkMatrixPriv::WriteToMemory(m, nullptr); size_t initialOffset = this->addDraw(DRAW_TEXT_ON_PATH, &size); this->addPaint(paint); this->addText(text, byteLength); @@ -682,7 +684,7 @@ void SkPictureRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* ma this->addPicture(picture); } else { const SkMatrix& m = matrix ? *matrix : SkMatrix::I(); - size += m.writeToMemory(nullptr) + kUInt32Size; // matrix + paint + size += SkMatrixPriv::WriteToMemory(m, nullptr) + kUInt32Size; // matrix + paint initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size); this->addPaintPtr(paint); this->addMatrix(m); @@ -700,7 +702,7 @@ void SkPictureRecord::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matri initialOffset = this->addDraw(DRAW_DRAWABLE, &size); this->addDrawable(drawable); } else { - size += matrix->writeToMemory(nullptr); // matrix + size += SkMatrixPriv::WriteToMemory(*matrix, nullptr); // matrix initialOffset = this->addDraw(DRAW_DRAWABLE_MATRIX, &size); this->addMatrix(*matrix); this->addDrawable(drawable); |