summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authormichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 19:03:14 +0000
committermichaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 19:03:14 +0000
commit4fa1077b67ab0be70dcb5185cc8b2223eaf4e321 (patch)
tree0c130e5b6a345d8c5acf9ccfd76c3f8c09b8c295 /skia
parent425853fe26f9e3e1b7629c8722340aeb9da7f3d9 (diff)
downloadchromium_src-4fa1077b67ab0be70dcb5185cc8b2223eaf4e321.zip
chromium_src-4fa1077b67ab0be70dcb5185cc8b2223eaf4e321.tar.gz
chromium_src-4fa1077b67ab0be70dcb5185cc8b2223eaf4e321.tar.bz2
Upstream the rest of skia diff
- Removed use-system-skia for android, as it didn't work now. - Combined multiple android condition into one. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10806077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/config/SkUserConfig.h13
-rw-r--r--skia/ext/image_operations.cc4
-rw-r--r--skia/ext/platform_device.h9
-rw-r--r--skia/skia.gyp51
4 files changed, 33 insertions, 44 deletions
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h
index fb80b3c..0b3f3c7 100644
--- a/skia/config/SkUserConfig.h
+++ b/skia/config/SkUserConfig.h
@@ -18,18 +18,18 @@
#define SkUserConfig_DEFINED
/* SkTypes.h, the root of the public header files, does the following trick:
-
+
#include <SkPreConfig.h>
#include <SkUserConfig.h>
#include <SkPostConfig.h>
-
+
SkPreConfig.h runs first, and it is responsible for initializing certain
skia defines.
-
+
SkPostConfig.h runs last, and its job is to just check that the final
defines are consistent (i.e. that we don't have mutually conflicting
defines).
-
+
SkUserConfig.h (this file) runs in the middle. It gets to change or augment
the list of flags initially set in preconfig, and then postconfig checks
that everything still makes sense.
@@ -71,7 +71,7 @@
parameter checking, but sometimes it can be quite intrusive (e.g. check that
each 32bit pixel is in premultiplied form). This code can be very useful
during development, but will slow things down in a shipping product.
-
+
By default, these mutually exclusive flags are defined in SkPreConfig.h,
based on the presence or absence of NDEBUG, but that decision can be changed
here.
@@ -186,11 +186,12 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
"%s:%d: failed assertion \"%s\"\n", \
__FILE__, __LINE__, #cond); } } while (false)
-// All little-endian Chrome platforms agree: BGRA is the optimal pixel layout.
+#if !defined(ANDROID) // On Android, we use the skia default settings.
#define SK_A32_SHIFT 24
#define SK_R32_SHIFT 16
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 0
+#endif
#if defined(SK_BUILD_FOR_WIN32)
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index 22d262a..d92e927 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -367,7 +367,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
"dst_pixels", dest_width*dest_height);
// Currently only works on Linux/BSD because these are the only platforms
// where SkFontHost::GetSubpixelOrder is defined.
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
// Understand the display.
const SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder();
const SkFontHost::LCDOrientation orientation =
@@ -465,7 +465,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
return result;
#else
return SkBitmap();
-#endif // OS_POSIX && !OS_MACOSX
+#endif // OS_POSIX && !OS_MACOSX && !defined(OS_ANDROID)
}
// static
diff --git a/skia/ext/platform_device.h b/skia/ext/platform_device.h
index dc1655a..627cd32 100644
--- a/skia/ext/platform_device.h
+++ b/skia/ext/platform_device.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -37,6 +37,9 @@ class PlatformDevice;
#if defined(OS_WIN)
typedef HDC PlatformSurface;
typedef RECT PlatformRect;
+#elif defined(ANDROID)
+typedef void* PlatformSurface;
+typedef SkIRect* PlatformRect;
#elif defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) \
|| defined(OS_SUN)
typedef cairo_t* PlatformSurface;
@@ -44,10 +47,6 @@ typedef cairo_rectangle_t PlatformRect;
#elif defined(OS_MACOSX)
typedef CGContextRef PlatformSurface;
typedef CGRect PlatformRect;
-#elif defined(ANDROID)
-// TODO(tonyg): FIX TYPES!
-typedef void* PlatformSurface;
-typedef void* PlatformRect;
#endif
// The following routines provide accessor points for the functionality
diff --git a/skia/skia.gyp b/skia/skia.gyp
index 8a9ee58..75ffdc6 100644
--- a/skia/skia.gyp
+++ b/skia/skia.gyp
@@ -814,7 +814,6 @@
'GR_STATIC_RECT_VB=1',
'GR_AGGRESSIVE_SHADER_OPTS=1',
'SK_DISABLE_FAST_AA_STROKE_RECT',
- 'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)',
'SK_DEFERRED_CANVAS_USES_GPIPE=1',
# temporary for landing Skia rev 3077 with minimal layout test breakage
@@ -831,7 +830,7 @@
# fix will require substantial rebaselining.
'SK_DRAW_POS_TEXT_IGNORE_SUBPIXEL_LEFT_ALIGN_FIX',
- # Temporarily ignore fix to antialias coverage, until we can rebaseline
+ # Temporarily ignore fix to antialias coverage, until we can rebaseline
'SK_USE_LEGACY_AA_COVERAGE',
],
'sources!': [
@@ -858,10 +857,11 @@
[ 'OS != "android"', {
'sources/': [
['exclude', '_android\\.(cc|cpp)$'],
- ],
- 'sources!': [
# Below files are only used by Android
- '../third_party/skia/src/ports/SkFontHost_gamma.cpp',
+ ['exclude', '../third_party/skia/src/ports/SkFontHost_gamma\\.cpp$'],
+ ],
+ 'defines': [
+ 'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)',
],
}],
[ 'OS != "mac"', {
@@ -916,13 +916,6 @@
'../third_party/skia/src/ports/SkFontHost_gamma_none.cpp',
],
}],
- [ 'OS == "android"', {
- 'sources/': [
- ['exclude', '_linux\\.(cc|cpp)$'],
- ['include', 'ext/platform_device_linux\\.cc$'],
- ['include', 'ext/platform_canvas_linux\\.cc$'],
- ],
- }],
[ 'use_aura == 1 and use_canvas_skia == 1', {
'sources/': [
['exclude', 'ext/platform_canvas_mac\\.cc$'],
@@ -940,20 +933,24 @@
'sources/': [ ['exclude', '_gtk\\.(cc|cpp)$'] ],
}],
[ 'OS == "android"', {
- 'defines': [
- 'SK_BUILD_FOR_ANDROID_NDK',
+ 'sources/': [
+ ['exclude', '_linux\\.(cc|cpp)$'],
],
'conditions': [
[ '_toolset == "target"', {
'defines': [
'HAVE_PTHREADS',
'OS_ANDROID',
+ 'SK_BUILD_FOR_ANDROID_NDK',
+ # Android devices are typically more memory constrained, so
+ # use a smaller glyph cache.
+ 'SK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)',
'USE_CHROMIUM_SKIA',
],
'dependencies': [
+ '../third_party/expat/expat.gyp:expat',
'../third_party/freetype/freetype.gyp:ft2',
'../third_party/harfbuzz/harfbuzz.gyp:harfbuzz',
- '../third_party/expat/expat.gyp:expat',
'skia_opts'
],
'dependencies!': [
@@ -967,6 +964,10 @@
'include_dirs': [
'../third_party/expat/files/lib',
],
+ 'sources/': [
+ ['include', 'ext/platform_device_linux\\.cc$'],
+ ['include', 'ext/platform_canvas_linux\\.cc$'],
+ ],
'sources!': [
'ext/vector_platform_device_skia.cc',
'../third_party/skia/src/pdf/SkPDFFont.cpp',
@@ -1089,23 +1090,11 @@
'skia_opts',
'../third_party/zlib/zlib.gyp:zlib',
],
+ 'defines': [
+ # Don't use non-NDK available stuff.
+ 'SK_BUILD_FOR_ANDROID_NDK',
+ ],
'conditions': [
- ['use_system_skia==1', {
- 'defines': [
- 'SK_RELEASE', # Assume platform has a release build.
- ],
- 'include_dirs!': [
- 'config', # Avoid including Chromium skia config.
- ],
- 'libraries': [
- '-lskia',
- ],
- }, { # !use_system_skia
- 'defines': [
- # Don't use non-NDK available stuff.
- 'SK_BUILD_FOR_ANDROID_NDK',
- ],
- }],
[ '_toolset == "target" and android_build_type == 0', {
'defines': [
'HAVE_ENDIAN_H',