Add support for building Android SampleApp.
Review URL: http://codereview.appspot.com/5342051
git-svn-id: http://skia.googlecode.com/svn/trunk@2617 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/views.gyp b/gyp/views.gyp
index 6d91c28..e91b28e 100644
--- a/gyp/views.gyp
+++ b/gyp/views.gyp
@@ -86,6 +86,21 @@
'../unix_test_app/main.cpp',
],
}],
+ [ 'skia_os == "android"', {
+ # Android does not support animator so we need to remove all files
+ # that have references to it.
+ 'include_dirs!': [
+ '../include/animator',
+ ],
+ 'sources!': [
+ '../src/views/SkBorderView.cpp',
+ '../src/views/SkImageView.cpp',
+ '../src/views/SkProgressBarView.cpp',
+ '../src/views/SkScrollBarView.cpp',
+ '../src/views/SkStaticTextView.cpp',
+ '../src/views/SkWidgetViews.cpp',
+ ],
+ }],
],
'direct_dependent_settings': {
'include_dirs': [
diff --git a/gyp/zlib.gyp b/gyp/zlib.gyp
index 7665505..5ed9d14 100644
--- a/gyp/zlib.gyp
+++ b/gyp/zlib.gyp
@@ -24,7 +24,7 @@
},
'defines': [ 'SK_ZLIB_INCLUDE=<zlib.h>', ],
}],
- [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
+ [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"]', {
'link_settings': { 'libraries': [ '-lz', ], },
'defines': [ 'SK_ZLIB_INCLUDE=<zlib.h>', ],
}],
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index cedc6a5..e95c10a 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1423,9 +1423,7 @@
return true;
case 'f':
// only
- fMeasureFPS = !fMeasureFPS;
- this->updateTitle();
- this->inval(NULL);
+ toggleFPS();
break;
case 'g':
fRequestGrabImage = true;
@@ -1494,6 +1492,12 @@
this->inval(NULL);
}
+void SampleWindow::toggleFPS() {
+ fMeasureFPS = !fMeasureFPS;
+ this->updateTitle();
+ this->inval(NULL);
+}
+
#include "SkDumpCanvas.h"
bool SampleWindow::onHandleKey(SkKey key) {