Update files to use SK_BUILD_FOR_ANDROID.

This CL also removes any unecessary references to
the ANDROID definition.
Review URL: http://codereview.appspot.com/5354049

git-svn-id: http://skia.googlecode.com/svn/trunk@2629 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/animator/SkDisplayEvent.cpp b/src/animator/SkDisplayEvent.cpp
index d295018..e3116d7 100644
--- a/src/animator/SkDisplayEvent.cpp
+++ b/src/animator/SkDisplayEvent.cpp
@@ -255,7 +255,7 @@
     return true;
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 
 #include "SkMetaData.h"
 #include "SkParse.h"
diff --git a/src/core/SkBitmapProcState_filter.h b/src/core/SkBitmapProcState_filter.h
index dcb93cf..f69e17a 100644
--- a/src/core/SkBitmapProcState_filter.h
+++ b/src/core/SkBitmapProcState_filter.h
@@ -7,12 +7,6 @@
  */
 
 
-#ifdef __arm__
-#ifdef ANDROID
-    #include <machine/cpu-features.h>
-#endif
-#endif
-
 #include "SkColorPriv.h"
 
 /*
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 1640a94..ea1c467 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1617,7 +1617,7 @@
     LOOPER_END
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 void SkCanvas::drawPosTextOnPath(const void* text, size_t byteLength,
                                  const SkPoint pos[], const SkPaint& paint,
                                  const SkPath& path, const SkMatrix* matrix) {
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index bf25ff1..a66f2a9 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -410,7 +410,7 @@
     draw.drawTextOnPath((const char*)text, len, path, matrix, paint);
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 void SkDevice::drawPosTextOnPath(const SkDraw& draw, const void* text, size_t len,
                                      const SkPoint pos[], const SkPaint& paint,
                                      const SkPath& path, const SkMatrix* matrix) {
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index e7bcee5..579e29a 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1973,7 +1973,7 @@
     }
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 void SkDraw::drawPosTextOnPath(const char text[], size_t byteLength,
                                const SkPoint pos[], const SkPaint& paint,
                                const SkPath& path, const SkMatrix* matrix) const {
diff --git a/src/core/SkMemory_stdlib.cpp b/src/core/SkMemory_stdlib.cpp
index 88194e5..0f195e7 100644
--- a/src/core/SkMemory_stdlib.cpp
+++ b/src/core/SkMemory_stdlib.cpp
@@ -159,18 +159,12 @@
 
 void sk_throw()
 {
-#ifdef ANDROID
-    fprintf(stderr, "throwing...\n");
-#endif
     SkASSERT(!"sk_throw");
     abort();
 }
 
 void sk_out_of_memory(void)
 {
-#ifdef ANDROID
-    fprintf(stderr,"- out of memory in SGL -\n");
-#endif
     SkASSERT(!"sk_out_of_memory");
     abort();
 }
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index aa1d7b1..ac9c68f 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -32,7 +32,7 @@
 
 #define SK_DefaultFlags         0   //(kNativeHintsText_Flag)
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 #define GEN_ID_INC                  fGenerationID++
 #define GEN_ID_INC_EVAL(expression) if (expression) { fGenerationID++; }
 #else
@@ -71,7 +71,7 @@
     fStyle      = kFill_Style;
     fTextEncoding = kUTF8_TextEncoding;
     fHinting    = kNormal_Hinting;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     fGenerationID = 0;
 #endif
 }
@@ -125,11 +125,11 @@
     SkSafeUnref(fLooper);
     SkSafeUnref(fImageFilter);
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     uint32_t oldGenerationID = fGenerationID;
 #endif
     memcpy(this, &src, sizeof(src));
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     fGenerationID = oldGenerationID + 1;
 #endif
 
@@ -143,16 +143,16 @@
 void SkPaint::reset() {
     SkPaint init;
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     uint32_t oldGenerationID = fGenerationID;
 #endif
     *this = init;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     fGenerationID = oldGenerationID + 1;
 #endif
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 uint32_t SkPaint::getGenerationID() const {
     return fGenerationID;
 }
@@ -377,7 +377,7 @@
     *((SkGlyphCache**)context) = SkGlyphCache::DetachCache(desc);
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 const SkGlyph& SkPaint::getUnicharMetrics(SkUnichar text) {
     SkGlyphCache* cache;
     descriptorProc(NULL, DetachDescProc, &cache, true);
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index cda2d4a..bdf4d27 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -93,7 +93,7 @@
     , fBoundsIsDirty(true) {
     fConvexity = kUnknown_Convexity;
     fSegmentMask = 0;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     fGenerationID = 0;
 #endif
 }
@@ -101,7 +101,7 @@
 SkPath::SkPath(const SkPath& src) {
     SkDEBUGCODE(src.validate();)
     *this = src;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     // the assignment operator above increments the ID so correct for that here
     fGenerationID--;
 #endif
@@ -156,7 +156,7 @@
     }
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 uint32_t SkPath::getGenerationID() const {
     return fGenerationID;
 }
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 60e1698..b75ae40 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -498,7 +498,7 @@
     SkipClipRec skipRect, skipRegion, skipPath;
 #endif
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     SkAutoMutexAcquire autoMutex(fDrawMutex);
 #endif
 
diff --git a/src/core/SkPicturePlayback.h b/src/core/SkPicturePlayback.h
index d227bc2..88f86e2 100644
--- a/src/core/SkPicturePlayback.h
+++ b/src/core/SkPicturePlayback.h
@@ -19,7 +19,7 @@
 #include "SkRegion.h"
 #include "SkPictureFlat.h"
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 #include "SkThread.h"
 #endif
 
@@ -174,7 +174,7 @@
     SkRefCntPlayback fRCPlayback;
     SkTypefacePlayback fTFPlayback;
     SkFactoryPlayback*   fFactoryPlayback;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     SkMutex fDrawMutex;
 #endif
 };
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index 2fd65cf..31eccc5 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -159,7 +159,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 void SkPixelRef::globalRef(void* data) {
     this->ref();
 }
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 10b58bf..334caa8 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -11,10 +11,6 @@
 #include "SkTemplates.h"
 #include "SkThread.h"
 
-#ifdef ANDROID
-#include <stdio.h>
-#endif
-
 SkDEBUGCODE(int32_t gRgnAllocCounter;)
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -171,7 +167,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 char* SkRegion::toString()
 {
     Iterator iter(*this);
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp
index 18323cc..8b7ebf3 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -108,7 +108,7 @@
     }
 }
 
-#if !defined(ANDROID) || defined(SK_BUILD_FOR_ANDROID_NDK)
+#if !defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_ANDROID_NDK)
 static void sk_memset16_stub(uint16_t dst[], uint16_t value, int count) {
     SkMemset16Proc proc = SkMemset16GetPlatformProc();
     sk_memset16 = proc ? proc : sk_memset16_portable;
diff --git a/src/effects/SkBlurDrawLooper.cpp b/src/effects/SkBlurDrawLooper.cpp
index 8746f9a..5021428 100644
--- a/src/effects/SkBlurDrawLooper.cpp
+++ b/src/effects/SkBlurDrawLooper.cpp
@@ -82,7 +82,7 @@
                 fState = kDone;
                 return false;
             }
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
             SkColor blurColor;
             blurColor = fBlurColor;
             if (SkColorGetA(blurColor) == 255) {
diff --git a/src/effects/SkPorterDuff.cpp b/src/effects/SkPorterDuff.cpp
index 515a3d4..8acb345 100644
--- a/src/effects/SkPorterDuff.cpp
+++ b/src/effects/SkPorterDuff.cpp
@@ -39,7 +39,7 @@
     MAKE_PAIR(Multiply),
     MAKE_PAIR(Screen),
     { SkPorterDuff::kAdd_Mode, SkXfermode::kPlus_Mode },
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
     MAKE_PAIR(Overlay),
 #endif
 };
diff --git a/src/opts/SkBitmapProcState_opts_arm.cpp b/src/opts/SkBitmapProcState_opts_arm.cpp
index 224f754..20d62e1 100644
--- a/src/opts/SkBitmapProcState_opts_arm.cpp
+++ b/src/opts/SkBitmapProcState_opts_arm.cpp
@@ -7,10 +7,6 @@
  */
 
 
-#ifdef ANDROID
-    #include <machine/cpu-features.h>
-#endif
-
 #include "SkBitmapProcState.h"
 #include "SkColorPriv.h"
 #include "SkUtils.h"
diff --git a/src/opts/SkBlitRow_opts_arm.cpp b/src/opts/SkBlitRow_opts_arm.cpp
index d653963..f882701 100644
--- a/src/opts/SkBlitRow_opts_arm.cpp
+++ b/src/opts/SkBlitRow_opts_arm.cpp
@@ -6,10 +6,6 @@
  */
 
 
-#ifdef ANDROID
-    #include <machine/cpu-features.h>
-#endif
-
 #include "SkBlitRow.h"
 #include "SkBlitMask.h"
 #include "SkColorPriv.h"
@@ -992,7 +988,7 @@
 
 	    /* calculate 'd', which will be 0..7 */
 	    /* dbase[] is 0..7; alpha is 0..256; 16 bits suffice */
-#if ANDROID
+#if SK_BUILD_FOR_ANDROID
 	    /* SkAlpha255To256() semantic a+1 vs a+a>>7 */
 	    alpha8 = vaddw_u8(vmovl_u8(sa), vdup_n_u8(1));
 #else
diff --git a/src/utils/SkCamera.cpp b/src/utils/SkCamera.cpp
index 328f588..a387257 100644
--- a/src/utils/SkCamera.cpp
+++ b/src/utils/SkCamera.cpp
@@ -362,7 +362,7 @@
     fRec = next;
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 void Sk3DView::setCameraLocation(SkScalar x, SkScalar y, SkScalar z) {
     // the camera location is passed in inches, set in pt
     SkScalar lz = z * SkFloatToScalar(72.0f);