aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-24 17:50:25 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-24 17:50:25 +0000
commit0eec2d0486e8a5184a95a48d31fdc8052774dec7 (patch)
tree99a3f63372bac300c7452760910266954d297d9c /src/utils
parentaa8483b49d069e15c9c8bce85bf2a440b27f5e9d (diff)
Remove SkSfntUtils, as it is not longer used.
git-svn-id: http://skia.googlecode.com/svn/trunk@4735 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkSfntUtils.cpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/src/utils/SkSfntUtils.cpp b/src/utils/SkSfntUtils.cpp
deleted file mode 100644
index d74a0e6409..0000000000
--- a/src/utils/SkSfntUtils.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "SkEndian.h"
-#include "SkSfntUtils.h"
-
-static uint16_t parse_be16(const uint8_t*& p) {
- uint16_t value = (p[0] << 8) | p[1];
- p += 2;
- return value;
-}
-
-static uint32_t parse_be32(const uint8_t*& p) {
- uint32_t value = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
- p += 4;
- return value;
-}
-
-static Sk64 parse_be64(const uint8_t*& p) {
- Sk64 value;
- value.fHi = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
- value.fLo = (p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7];
- p += 8;
- return value;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-bool SkSfntUtils::ReadTable_head(SkTypeface& typeface, SkSfntTable_head* head) {
- static const uint32_t gTag = SkSetFourByteTag('h', 'e', 'a', 'd');
- static const size_t gSize = 54;
-
- uint8_t storage[gSize];
- size_t size = typeface.getTableData(gTag, 0, gSize, storage);
- if (size != gSize) {
- return false;
- }
-
- const uint8_t* p = storage;
- head->fVersion = parse_be32(p);
- head->fRevision = parse_be32(p);
- head->fCheckSumAdjustment = parse_be32(p);
- head->fMagicNumber = parse_be32(p);
- head->fFlags = parse_be16(p);
- head->fUnitsPerEm = parse_be16(p);
- head->fDateCreated = parse_be64(p);
- head->fDateModified = parse_be64(p);
- head->fXMin = parse_be16(p);
- head->fXMin = parse_be16(p);
- head->fXMin = parse_be16(p);
- head->fXMin = parse_be16(p);
- head->fMacStyle = parse_be16(p);
- head->fLowestPPEM = parse_be16(p);
- head->fFontDirectionHint = parse_be16(p);
- head->fIndexToLocFormat = parse_be16(p);
- head->fGlyphDataFormat = parse_be16(p);
- SkASSERT(p - storage == (long)size);
- return true;
-}
-
-bool SkSfntUtils::ReadTable_maxp(SkTypeface& typeface, SkSfntTable_maxp* maxp) {
- static const uint32_t gTag = SkSetFourByteTag('m', 'a', 'x', 'p');
- static const size_t gSize = 32;
-
- uint8_t storage[gSize];
- size_t size = typeface.getTableData(gTag, 0, gSize, storage);
- if (size != gSize) {
- return false;
- }
-
- const uint8_t* p = storage;
- maxp->fVersion = parse_be32(p);
- maxp->fNumGlyphs = parse_be16(p);
- maxp->fMaxPoints = parse_be16(p);
- maxp->fMaxContours = parse_be16(p);
- maxp->fMaxComponentPoints = parse_be16(p);
- maxp->fMaxComponentContours = parse_be16(p);
- maxp->fMaxZones = parse_be16(p);
- maxp->fMaxTwilightPoints = parse_be16(p);
- maxp->fMaxStorage = parse_be16(p);
- maxp->fMaxFunctionDefs = parse_be16(p);
- maxp->fMaxInstructionDefs = parse_be16(p);
- maxp->fMaxStackElements = parse_be16(p);
- maxp->fMaxSizeOfInstructions = parse_be16(p);
- maxp->fMaxComponentElements = parse_be16(p);
- maxp->fMaxComponentDepth = parse_be16(p);
- SkASSERT(p - storage == (long)size);
- return true;
-}
-