Add support for building Android SampleApp.
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 7 Nov 2011 15:43:57 +0000 (15:43 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 7 Nov 2011 15:43:57 +0000 (15:43 +0000)
Review URL: http://codereview.appspot.com/5342051

git-svn-id: http://skia.googlecode.com/svn/trunk@2617 2bbb7eff-a529-9590-31e7-b0007b416f81

gyp/views.gyp
gyp/zlib.gyp
samplecode/SampleApp.cpp

index 6d91c28..e91b28e 100644 (file)
             '../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': [
index 7665505..5ed9d14 100644 (file)
@@ -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>', ],
         }],
index cedc6a5..e95c10a 100644 (file)
@@ -1423,9 +1423,7 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
             return true;
         case 'f':
             // only 
-            fMeasureFPS = !fMeasureFPS;
-            this->updateTitle();
-            this->inval(NULL);
+            toggleFPS();
             break;
         case 'g':
             fRequestGrabImage = true;
@@ -1494,6 +1492,12 @@ void SampleWindow::toggleRendering() {
     this->inval(NULL);
 }
 
+void SampleWindow::toggleFPS() {
+    fMeasureFPS = !fMeasureFPS;
+    this->updateTitle();
+    this->inval(NULL);
+}
+
 #include "SkDumpCanvas.h"
 
 bool SampleWindow::onHandleKey(SkKey key) {