Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: src/sfnt/SkOTTable_name.cpp

Issue 14873006: XPS ttc handling. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix clang error about typename and dependent type. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/sfnt/SkTTCFHeader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sfnt/SkOTTable_name.cpp
===================================================================
--- src/sfnt/SkOTTable_name.cpp (revision 9016)
+++ src/sfnt/SkOTTable_name.cpp (working copy)
@@ -10,6 +10,7 @@
#include "SkEndian.h"
#include "SkString.h"
#include "SkTSearch.h"
+#include "SkTemplates.h"
#include "SkUtils.h"
static SkUnichar SkUTF16BE_NextUnichar(const uint16_t** srcPtr) {
@@ -435,14 +436,6 @@
}
}
-template <typename D, typename S> static D* SkTAfter(S const * const ptr, size_t count = 1) {
- return (D*)(ptr + count);
-}
-
-template <typename D, typename S> static D* SkTAddOffset(S const * const ptr, size_t byteOffset) {
- return (D*)((char*)ptr + byteOffset);
-}
-
bool SkOTTableName::Iterator::next(SkOTTableName::Iterator::Record& record) {
const size_t nameRecordsCount = SkEndian_SwapBE16(fName.count);
const SkOTTableName::Record* nameRecords = SkTAfter<const SkOTTableName::Record>(&fName);
@@ -459,12 +452,12 @@
} while (fType != -1 && nameRecord->nameID.fontSpecific != fType);
const uint16_t stringTableOffset = SkEndian_SwapBE16(fName.stringOffset);
- const char* stringTable = SkTAddOffset<char>(&fName, stringTableOffset);
+ const char* stringTable = SkTAddOffset<const char>(&fName, stringTableOffset);
// Decode the name into UTF-8.
const uint16_t nameOffset = SkEndian_SwapBE16(nameRecord->offset);
const uint16_t nameLength = SkEndian_SwapBE16(nameRecord->length);
- const char* nameString = SkTAddOffset<char>(stringTable, nameOffset);
+ const char* nameString = SkTAddOffset<const char>(stringTable, nameOffset);
switch (nameRecord->platformID.value) {
case SkOTTableName::Record::PlatformID::Windows:
SkASSERT(SkOTTableName::Record::EncodingID::Windows::UnicodeBMPUCS2
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/sfnt/SkTTCFHeader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698