aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fonts/SkFontMgr_indirect.cpp13
-rw-r--r--src/ports/SkDebug_stdio.cpp2
-rw-r--r--src/ports/SkDiscardableMemory_none.cpp1
-rw-r--r--src/ports/SkFontConfigInterface_direct.cpp16
-rw-r--r--src/ports/SkFontHost_fontconfig.cpp2
-rw-r--r--src/ports/SkFontMgr_android.cpp21
-rw-r--r--src/ports/SkFontMgr_android_parser.cpp5
-rw-r--r--src/ports/SkFontMgr_android_parser.h3
-rw-r--r--src/ports/SkFontMgr_custom.cpp17
-rw-r--r--src/ports/SkFontMgr_fontconfig.cpp12
-rw-r--r--src/ports/SkFontMgr_fontconfig_factory.cpp1
-rw-r--r--src/ports/SkGlobalInitialization_default.cpp4
-rw-r--r--src/ports/SkMemory_malloc.cpp4
-rw-r--r--src/ports/SkOSFile_posix.cpp4
-rw-r--r--src/ports/SkOSFile_stdio.cpp2
-rw-r--r--src/ports/SkTime_Unix.cpp2
16 files changed, 65 insertions, 44 deletions
diff --git a/src/fonts/SkFontMgr_indirect.cpp b/src/fonts/SkFontMgr_indirect.cpp
index 172d5412a6..6ad8bfbf47 100644
--- a/src/fonts/SkFontMgr_indirect.cpp
+++ b/src/fonts/SkFontMgr_indirect.cpp
@@ -5,17 +5,22 @@
* found in the LICENSE file.
*/
-#include "SkFontMgr_indirect.h"
-
#include "SkDataTable.h"
+#include "SkFontMgr.h"
+#include "SkFontMgr_indirect.h"
#include "SkFontStyle.h"
+#include "SkMutex.h"
#include "SkOnce.h"
+#include "SkRefCnt.h"
+#include "SkRemotableFontMgr.h"
#include "SkStream.h"
-#include "SkTSearch.h"
+#include "SkString.h"
+#include "SkTArray.h"
#include "SkTypeface.h"
+#include "SkTypes.h"
+#include "SkTemplates.h"
class SkData;
-class SkString;
class SkStyleSet_Indirect : public SkFontStyleSet {
public:
diff --git a/src/ports/SkDebug_stdio.cpp b/src/ports/SkDebug_stdio.cpp
index 8ff27ade3c..9e72d4797e 100644
--- a/src/ports/SkDebug_stdio.cpp
+++ b/src/ports/SkDebug_stdio.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 The Android Open Source Project
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#include "SkTypes.h"
#include <stdarg.h>
diff --git a/src/ports/SkDiscardableMemory_none.cpp b/src/ports/SkDiscardableMemory_none.cpp
index 51c3164dfa..7e5c0aeade 100644
--- a/src/ports/SkDiscardableMemory_none.cpp
+++ b/src/ports/SkDiscardableMemory_none.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkDiscardableMemory.h"
#include "SkDiscardableMemoryPool.h"
#include "SkTypes.h"
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index 8589cc2421..9ef088d8b7 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -7,17 +7,21 @@
/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <fontconfig/fontconfig.h>
-
#include "SkBuffer.h"
+#include "SkDataTable.h"
#include "SkFontConfigInterface.h"
-#include "SkLazyPtr.h"
+#include "SkFontStyle.h"
#include "SkMutex.h"
#include "SkStream.h"
#include "SkString.h"
+#include "SkTArray.h"
+#include "SkTDArray.h"
+#include "SkTemplates.h"
+#include "SkTypeface.h"
+#include "SkTypes.h"
+
+#include <fontconfig/fontconfig.h>
+#include <unistd.h>
size_t SkFontConfigInterface::FontIdentity::writeToMemory(void* addr) const {
size_t size = sizeof(fID) + sizeof(fTTCIndex);
diff --git a/src/ports/SkFontHost_fontconfig.cpp b/src/ports/SkFontHost_fontconfig.cpp
index 2fdb16e364..540d805c38 100644
--- a/src/ports/SkFontHost_fontconfig.cpp
+++ b/src/ports/SkFontHost_fontconfig.cpp
@@ -8,8 +8,6 @@
#include "SkFontConfigInterface.h"
#include "SkFontConfigTypeface.h"
#include "SkFontDescriptor.h"
-#include "SkFontHost_FreeType_common.h"
-#include "SkFontStream.h"
#include "SkStream.h"
#include "SkTypeface.h"
#include "SkTypefaceCache.h"
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index f85539ca53..88045a4b20 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -5,20 +5,27 @@
* found in the LICENSE file.
*/
+#include "SkFixed.h"
#include "SkFontDescriptor.h"
#include "SkFontHost_FreeType_common.h"
#include "SkFontMgr.h"
#include "SkFontMgr_android.h"
#include "SkFontMgr_android_parser.h"
#include "SkFontStyle.h"
+#include "SkRefCnt.h"
+#include "SkString.h"
#include "SkStream.h"
+#include "SkTArray.h"
#include "SkTDArray.h"
#include "SkTSearch.h"
+#include "SkTemplates.h"
#include "SkTypeface.h"
#include "SkTypefaceCache.h"
#include <limits>
+class SkData;
+
class SkTypeface_Android : public SkTypeface_FreeType {
public:
SkTypeface_Android(const SkFontStyle& style,
@@ -275,9 +282,9 @@ private:
}
static int match_score(const SkFontStyle& pattern, const SkFontStyle& candidate) {
int score = 0;
- score += abs((pattern.width() - candidate.width()) * 100);
- score += abs((pattern.isItalic() == candidate.isItalic()) ? 0 : 1000);
- score += abs(pattern.weight() - candidate.weight());
+ score += SkTAbs((pattern.width() - candidate.width()) * 100);
+ score += SkTAbs((pattern.isItalic() == candidate.isItalic()) ? 0 : 1000);
+ score += SkTAbs(pattern.weight() - candidate.weight());
return score;
}
@@ -400,13 +407,7 @@ protected:
continue;
}
- SkPaint paint;
- paint.setTypeface(face);
- paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);
-
- uint16_t glyphID;
- paint.textToGlyphs(&character, sizeof(character), &glyphID);
- if (glyphID != 0) {
+ if (face->charsToGlyphs(&character, SkTypeface::kUTF32_Encoding, NULL, 0)) {
return face.detach();
}
}
diff --git a/src/ports/SkFontMgr_android_parser.cpp b/src/ports/SkFontMgr_android_parser.cpp
index 5ca6d4fcc5..53decf36cf 100644
--- a/src/ports/SkFontMgr_android_parser.cpp
+++ b/src/ports/SkFontMgr_android_parser.cpp
@@ -9,12 +9,13 @@
#include "SkStream.h"
#include "SkTDArray.h"
#include "SkTSearch.h"
-#include "SkTypeface.h"
+#include "SkTemplates.h"
-#include <expat.h>
#include <dirent.h>
+#include <expat.h>
#include <stdlib.h>
+#include <string.h>
#define LMP_SYSTEM_FONTS_FILE "/system/etc/fonts.xml"
#define OLD_SYSTEM_FONTS_FILE "/system/etc/system_fonts.xml"
diff --git a/src/ports/SkFontMgr_android_parser.h b/src/ports/SkFontMgr_android_parser.h
index d2a430513f..175a6fa1fe 100644
--- a/src/ports/SkFontMgr_android_parser.h
+++ b/src/ports/SkFontMgr_android_parser.h
@@ -8,8 +8,11 @@
#ifndef SkFontMgr_android_parser_DEFINED
#define SkFontMgr_android_parser_DEFINED
+#include "SkFixed.h"
#include "SkString.h"
+#include "SkTArray.h"
#include "SkTDArray.h"
+#include "SkTypes.h"
#include <climits>
#include <limits>
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index cea0b4875e..835acd786f 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -5,22 +5,25 @@
* found in the LICENSE file.
*/
-#include "SkFontHost_FreeType_common.h"
#include "SkFontDescriptor.h"
+#include "SkFontHost_FreeType_common.h"
#include "SkFontMgr.h"
#include "SkFontMgr_custom.h"
-#include "SkDescriptor.h"
+#include "SkFontStyle.h"
#include "SkOSFile.h"
-#include "SkPaint.h"
-#include "SkRTConf.h"
-#include "SkString.h"
+#include "SkRefCnt.h"
#include "SkStream.h"
-#include "SkTSearch.h"
-#include "SkTypefaceCache.h"
+#include "SkString.h"
#include "SkTArray.h"
+#include "SkTemplates.h"
+#include "SkTypeface.h"
+#include "SkTypefaceCache.h"
+#include "SkTypes.h"
#include <limits>
+class SkData;
+
/** The base SkTypeface implementation for the custom font manager. */
class SkTypeface_Custom : public SkTypeface_FreeType {
public:
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index 7000e31db4..e98bd01995 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -6,19 +6,27 @@
*/
#include "SkDataTable.h"
+#include "SkFixed.h"
#include "SkFontDescriptor.h"
#include "SkFontHost_FreeType_common.h"
#include "SkFontMgr.h"
#include "SkFontStyle.h"
#include "SkMath.h"
#include "SkMutex.h"
-#include "SkString.h"
+#include "SkOSFile.h"
+#include "SkRefCnt.h"
#include "SkStream.h"
+#include "SkString.h"
#include "SkTDArray.h"
+#include "SkTemplates.h"
+#include "SkTypeface.h"
#include "SkTypefaceCache.h"
-#include "SkOSFile.h"
+#include "SkTypes.h"
#include <fontconfig/fontconfig.h>
+#include <string.h>
+
+class SkData;
// FC_POSTSCRIPT_NAME was added with b561ff20 which ended up in 2.10.92
// Ubuntu 12.04 is on 2.8.0, 13.10 is on 2.10.93
diff --git a/src/ports/SkFontMgr_fontconfig_factory.cpp b/src/ports/SkFontMgr_fontconfig_factory.cpp
index b959acbbe2..78792fa989 100644
--- a/src/ports/SkFontMgr_fontconfig_factory.cpp
+++ b/src/ports/SkFontMgr_fontconfig_factory.cpp
@@ -7,6 +7,7 @@
#include "SkFontMgr.h"
#include "SkFontMgr_fontconfig.h"
+#include "SkTypes.h"
SkFontMgr* SkFontMgr::Factory() {
return SkFontMgr_New_FontConfig(NULL);
diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp
index 0f7d71b207..fb496f65cb 100644
--- a/src/ports/SkGlobalInitialization_default.cpp
+++ b/src/ports/SkGlobalInitialization_default.cpp
@@ -5,12 +5,8 @@
* found in the LICENSE file.
*/
-#include "SkTypes.h"
-
#include "SkBitmapProcShader.h"
-#include "SkMallocPixelRef.h"
#include "SkPathEffect.h"
-#include "SkPixelRef.h"
#include "SkXfermode.h"
#include "Sk1DPathEffect.h"
diff --git a/src/ports/SkMemory_malloc.cpp b/src/ports/SkMemory_malloc.cpp
index 0b936c9f8c..f9836c0e0e 100644
--- a/src/ports/SkMemory_malloc.cpp
+++ b/src/ports/SkMemory_malloc.cpp
@@ -1,12 +1,12 @@
-
/*
* 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 "SkTypes.h"
-#include <stdio.h>
+
#include <stdlib.h>
#define SK_DEBUGFAILF(fmt, ...) \
diff --git a/src/ports/SkOSFile_posix.cpp b/src/ports/SkOSFile_posix.cpp
index cea688b86f..6f64478d04 100644
--- a/src/ports/SkOSFile_posix.cpp
+++ b/src/ports/SkOSFile_posix.cpp
@@ -6,12 +6,14 @@
*/
#include "SkOSFile.h"
-
+#include "SkString.h"
#include "SkTFitsIn.h"
+#include "SkTemplates.h"
#include "SkTypes.h"
#include <dirent.h>
#include <stdio.h>
+#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp
index d63462549c..a7d776afb1 100644
--- a/src/ports/SkOSFile_stdio.cpp
+++ b/src/ports/SkOSFile_stdio.cpp
@@ -6,11 +6,11 @@
*/
#include "SkOSFile.h"
+#include "SkTypes.h"
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
-#include <sys/types.h>
#ifdef _WIN32
#include <direct.h>
diff --git a/src/ports/SkTime_Unix.cpp b/src/ports/SkTime_Unix.cpp
index 2d5fa279b4..84f1a4e374 100644
--- a/src/ports/SkTime_Unix.cpp
+++ b/src/ports/SkTime_Unix.cpp
@@ -6,8 +6,8 @@
* found in the LICENSE file.
*/
-
#include "SkTime.h"
+#include "SkTypes.h"
#include <sys/time.h>
#include <time.h>