aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sfnt/SkOTUtils.cpp
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-07 21:30:21 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-07 21:30:21 +0000
commit8ec9956bdfc173132de52acf1aa03746fabca287 (patch)
tree69ee75bf96364338cfc14e6842412ff4bcb9b939 /src/sfnt/SkOTUtils.cpp
parente7a0a16599cb39085220e4e12fa4affd6f3560b2 (diff)
Add more TT table definitions and create fake enum typedef.
git-svn-id: http://skia.googlecode.com/svn/trunk@3150 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/sfnt/SkOTUtils.cpp')
-rw-r--r--src/sfnt/SkOTUtils.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sfnt/SkOTUtils.cpp b/src/sfnt/SkOTUtils.cpp
new file mode 100644
index 0000000000..1301a06e02
--- /dev/null
+++ b/src/sfnt/SkOTUtils.cpp
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkOTTableTypes.h"
+#include "SkOTUtils.h"
+
+uint32_t SkOTUtils::CalcTableChecksum(SK_OT_ULONG *data, size_t length) {
+ uint32_t sum = 0;
+ SK_OT_ULONG *dataEnd = data + ((length + 3) & ~3) / sizeof(SK_OT_ULONG);
+ for (; data < dataEnd; ++data) {
+ sum += SkEndian_SwapBE32(*data);
+ }
+ return sum;
+}