diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-24 17:50:25 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-24 17:50:25 +0000 |
commit | 0eec2d0486e8a5184a95a48d31fdc8052774dec7 (patch) | |
tree | 99a3f63372bac300c7452760910266954d297d9c | |
parent | aa8483b49d069e15c9c8bce85bf2a440b27f5e9d (diff) |
Remove SkSfntUtils, as it is not longer used.
git-svn-id: http://skia.googlecode.com/svn/trunk@4735 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gyp/utils.gyp | 2 | ||||
-rw-r--r-- | include/utils/SkSfntUtils.h | 60 | ||||
-rw-r--r-- | src/utils/SkSfntUtils.cpp | 94 |
3 files changed, 0 insertions, 156 deletions
diff --git a/gyp/utils.gyp b/gyp/utils.gyp index bdfcc6c817..8b919a31d0 100644 --- a/gyp/utils.gyp +++ b/gyp/utils.gyp @@ -32,7 +32,6 @@ '../include/utils/SkParsePaint.h', '../include/utils/SkParsePath.h', '../include/utils/SkProxyCanvas.h', - '../include/utils/SkSfntUtils.h', '../include/utils/SkUnitMappers.h', '../include/utils/SkWGL.h', @@ -58,7 +57,6 @@ '../src/utils/SkParseColor.cpp', '../src/utils/SkParsePath.cpp', '../src/utils/SkProxyCanvas.cpp', - '../src/utils/SkSfntUtils.cpp', '../src/utils/SkThreadUtils.h', '../src/utils/SkThreadUtils_pthread.cpp', '../src/utils/SkThreadUtils_pthread.h', diff --git a/include/utils/SkSfntUtils.h b/include/utils/SkSfntUtils.h deleted file mode 100644 index 4e8d7548f9..0000000000 --- a/include/utils/SkSfntUtils.h +++ /dev/null @@ -1,60 +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. - */ - -#ifndef SkSfntUtils_DEFINED -#define SkSfntUtils_DEFINED - -#include "Sk64.h" -#include "SkTypeface.h" - -struct SkSfntTable_head { - SkFixed fVersion; - SkFixed fRevision; - uint32_t fCheckSumAdjustment; - uint32_t fMagicNumber; - uint16_t fFlags; - uint16_t fUnitsPerEm; - Sk64 fDateCreated; - Sk64 fDateModified; - int16_t fXMin; - int16_t fYMin; - int16_t fXMax; - int16_t fYMax; - uint16_t fMacStyle; - uint16_t fLowestPPEM; - int16_t fFontDirectionHint; - int16_t fIndexToLocFormat; - int16_t fGlyphDataFormat; -}; - -struct SkSfntTable_maxp { - SkFixed fVersion; - uint16_t fNumGlyphs; - uint16_t fMaxPoints; - uint16_t fMaxContours; - uint16_t fMaxComponentPoints; - uint16_t fMaxComponentContours; - uint16_t fMaxZones; - uint16_t fMaxTwilightPoints; - uint16_t fMaxStorage; - uint16_t fMaxFunctionDefs; - uint16_t fMaxInstructionDefs; - uint16_t fMaxStackElements; - uint16_t fMaxSizeOfInstructions; - uint16_t fMaxComponentElements; - uint16_t fMaxComponentDepth; -}; - -class SkSfntUtils { -public: - static bool ReadTable_head(SkTypeface&, SkSfntTable_head*); - static bool ReadTable_maxp(SkTypeface&, SkSfntTable_maxp*); -}; - -#endif - 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; -} - |