aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/MatrixTest.cpp
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 /tests/MatrixTest.cpp
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 'tests/MatrixTest.cpp')
-rw-r--r--tests/MatrixTest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 578e8b06cf..18d4908416 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -6,7 +6,7 @@
*/
#include "SkMath.h"
-#include "SkMatrix.h"
+#include "SkMatrixPriv.h"
#include "SkMatrixUtils.h"
#include "SkPoint3.h"
#include "SkRandom.h"
@@ -141,20 +141,20 @@ static void test_matrix_recttorect(skiatest::Reporter* reporter) {
static void test_flatten(skiatest::Reporter* reporter, const SkMatrix& m) {
// add 100 in case we have a bug, I don't want to kill my stack in the test
- static const size_t kBufferSize = SkMatrix::kMaxFlattenSize + 100;
+ static const size_t kBufferSize = SkMatrixPriv::kMaxFlattenSize + 100;
char buffer[kBufferSize];
- size_t size1 = m.writeToMemory(nullptr);
- size_t size2 = m.writeToMemory(buffer);
+ size_t size1 = SkMatrixPriv::WriteToMemory(m, nullptr);
+ size_t size2 = SkMatrixPriv::WriteToMemory(m, buffer);
REPORTER_ASSERT(reporter, size1 == size2);
- REPORTER_ASSERT(reporter, size1 <= SkMatrix::kMaxFlattenSize);
+ REPORTER_ASSERT(reporter, size1 <= SkMatrixPriv::kMaxFlattenSize);
SkMatrix m2;
- size_t size3 = m2.readFromMemory(buffer, kBufferSize);
+ size_t size3 = SkMatrixPriv::ReadFromMemory(&m2, buffer, kBufferSize);
REPORTER_ASSERT(reporter, size1 == size3);
REPORTER_ASSERT(reporter, are_equal(reporter, m, m2));
char buffer2[kBufferSize];
- size3 = m2.writeToMemory(buffer2);
+ size3 = SkMatrixPriv::WriteToMemory(m2, buffer2);
REPORTER_ASSERT(reporter, size1 == size3);
REPORTER_ASSERT(reporter, memcmp(buffer, buffer2, size1) == 0);
}