aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-08 19:00:26 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-08 19:00:26 +0000
commit56c69773aea56c6c6bd47bc7e7970dd081205184 (patch)
tree8897eb8c11b991b04cb60cc9283d7c541d8217f0 /src
parent6245ab718dea4dfb6415e97de6e8667f4b13de38 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/animator/SkDisplayEvent.cpp2
-rw-r--r--src/core/SkBitmapProcState_filter.h6
-rw-r--r--src/core/SkCanvas.cpp2
-rw-r--r--src/core/SkDevice.cpp2
-rw-r--r--src/core/SkDraw.cpp2
-rw-r--r--src/core/SkMemory_stdlib.cpp6
-rw-r--r--src/core/SkPaint.cpp16
-rw-r--r--src/core/SkPath.cpp6
-rw-r--r--src/core/SkPicturePlayback.cpp2
-rw-r--r--src/core/SkPicturePlayback.h4
-rw-r--r--src/core/SkPixelRef.cpp2
-rw-r--r--src/core/SkRegion.cpp6
-rw-r--r--src/core/SkUtils.cpp2
-rw-r--r--src/effects/SkBlurDrawLooper.cpp2
-rw-r--r--src/effects/SkPorterDuff.cpp2
-rw-r--r--src/opts/SkBitmapProcState_opts_arm.cpp4
-rw-r--r--src/opts/SkBlitRow_opts_arm.cpp6
-rw-r--r--src/utils/SkCamera.cpp2
18 files changed, 25 insertions, 49 deletions
diff --git a/src/animator/SkDisplayEvent.cpp b/src/animator/SkDisplayEvent.cpp
index d29501842f..e3116d7789 100644
--- a/src/animator/SkDisplayEvent.cpp
+++ b/src/animator/SkDisplayEvent.cpp
@@ -255,7 +255,7 @@ bool SkDisplayEvent::setProperty(int index, SkScriptValue& value) {
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 dcb93cfef6..f69e17a4a6 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 1640a94926..ea1c4675c1 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1617,7 +1617,7 @@ void SkCanvas::drawTextOnPath(const void* text, size_t byteLength,
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 bf25ff1f8c..a66f2a9872 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -410,7 +410,7 @@ void SkDevice::drawTextOnPath(const SkDraw& draw, const void* text,
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 e7bcee5945..579e29a1ac 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1973,7 +1973,7 @@ void SkDraw::drawTextOnPath(const char text[], size_t byteLength,
}
}
-#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 88194e5ff1..0f195e7ce8 100644
--- a/src/core/SkMemory_stdlib.cpp
+++ b/src/core/SkMemory_stdlib.cpp
@@ -159,18 +159,12 @@ void ValidateHeap() {}
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 aa1d7b16fc..ac9c68fd7a 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 @@ SkPaint::SkPaint() {
fStyle = kFill_Style;
fTextEncoding = kUTF8_TextEncoding;
fHinting = kNormal_Hinting;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
fGenerationID = 0;
#endif
}
@@ -125,11 +125,11 @@ SkPaint& SkPaint::operator=(const SkPaint& src) {
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 @@ bool operator==(const SkPaint& a, const SkPaint& b) {
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 @@ static void DetachDescProc(const SkDescriptor* desc, void* context) {
*((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 cda2d4a711..bdf4d278b1 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -93,7 +93,7 @@ SkPath::SkPath()
, fBoundsIsDirty(true) {
fConvexity = kUnknown_Convexity;
fSegmentMask = 0;
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
fGenerationID = 0;
#endif
}
@@ -101,7 +101,7 @@ SkPath::SkPath()
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 @@ void SkPath::swap(SkPath& other) {
}
}
-#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 60e1698121..b75ae40215 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -498,7 +498,7 @@ void SkPicturePlayback::draw(SkCanvas& canvas) {
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 d227bc2924..88f86e2db2 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 @@ private:
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 2fd65cf941..31eccc5112 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -159,7 +159,7 @@ const char* SkPixelRef::FactoryToName(Factory fact) {
///////////////////////////////////////////////////////////////////////////////
-#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 10b58bf2a1..334caa8aba 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 @@ bool SkRegion::op(const SkRegion& rgn, const SkIRect& rect, Op op) {
///////////////////////////////////////////////////////////////////////////////
-#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 18323cc09d..8b7ebf3fd4 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -108,7 +108,7 @@ void sk_memset32_portable(uint32_t dst[], uint32_t value, int count) {
}
}
-#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 8746f9a83e..50214285aa 100644
--- a/src/effects/SkBlurDrawLooper.cpp
+++ b/src/effects/SkBlurDrawLooper.cpp
@@ -82,7 +82,7 @@ bool SkBlurDrawLooper::next(SkCanvas* canvas, SkPaint* paint) {
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 515a3d4d2b..8acb3453cf 100644
--- a/src/effects/SkPorterDuff.cpp
+++ b/src/effects/SkPorterDuff.cpp
@@ -39,7 +39,7 @@ static const struct Pair {
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 224f754069..20d62e1455 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 d6539634c9..f8827015e3 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 @@ static void S32A_D565_Opaque_Dither_neon (uint16_t * SK_RESTRICT dst,
/* 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 328f588090..a3872571ba 100644
--- a/src/utils/SkCamera.cpp
+++ b/src/utils/SkCamera.cpp
@@ -362,7 +362,7 @@ void Sk3DView::restore() {
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);