blob: 85cda1cb58e21768339967f216f3842bf552f3f9 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SkUserConfig_DEFINED
18#define SkUserConfig_DEFINED
19
20// for floats
21#ifdef SK_SCALAR_IS_FIXED
22#undef SK_SCALAR_IS_FIXED
23#endif
24#define SK_SCALAR_IS_FLOAT
25
26// remove the x if you want to force us into SK_DEBUG mode
27#ifdef SK_RELEASE
28 #undef SK_RELEASE
29 #define SK_DEBUG
30#endif
31
32// remove the x if you want to force us into SK_RELEASE mode
33#ifdef SK_DEBUGx
34 #undef SK_DEBUG
35 #define SK_RELEASE
36#endif
37
38#ifdef ANDROID
39 #include <utils/misc.h>
40 #include <assert.h>
41
42 #define SK_CRASH() *(int *)(uintptr_t)0 = 0
43// #define SK_CRASH() assert(0)
44
45#if 0
46 // force fixed
47 #define SK_SCALAR_IS_FIXED
48 #undef SK_SCALAR_IS_FLOAT
49#else
50 // force floats
51 #ifdef SK_SCALAR_IS_FIXED
52 #undef SK_SCALAR_IS_FIXED
53 #endif
54 #define SK_SCALAR_IS_FLOAT
55#endif
56
57 #define SK_CAN_USE_FLOAT
58 #define SK_SOFTWARE_FLOAT
59 #define SkLONGLONG int64_t
60
61 // replace some sw float routines (floor, ceil, etc.)
62 #define SK_USE_FLOATBITS
63
64 #if __BYTE_ORDER == __BIG_ENDIAN
65 #define SK_CPU_BENDIAN
66 #undef SK_CPU_LENDIAN
67 #else
68 #define SK_CPU_LENDIAN
69 #undef SK_CPU_BENDIAN
70 #endif
71
72 // define SkDebugf to record file/line
73 #define SkDebugf(...) Android_SkDebugf(__FILE__, __LINE__, \
74 __FUNCTION__, __VA_ARGS__)
75 void Android_SkDebugf(const char* file, int line,
76 const char* function, const char* format, ...);
77#endif
78
79/* This file is included before all other headers, except for SkPreConfig.h.
80 That file uses various heuristics to make a "best guess" at settings for
81 the following build defines.
82
83 However, in this file you can override any of those decisions by either
84 defining new symbols, or #undef symbols that were already set.
85*/
86
87// experimental for now
88#define SK_SUPPORT_MIPMAP
89
90#ifdef SK_DEBUG
91 #define SK_SUPPORT_UNITTEST
92 /* Define SK_SIMULATE_FAILED_MALLOC to have
93 * sk_malloc throw an exception. Use this to
94 * detect unhandled memory leaks. */
95 //#define SK_SIMULATE_FAILED_MALLOC
96 //#define SK_FIND_MEMORY_LEAKS
97#endif
98
99#ifdef SK_BUILD_FOR_BREW
100 #include "SkBrewUserConfig.h"
101#endif
102
103#endif
104