summaryrefslogtreecommitdiffstats
path: root/skia/include/corecg/SkUserConfig.h
blob: be7622fd888cb224163a1319682482b9be6c73c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* include/corecg/SkUserConfig.h
**
** Copyright 2006, Google Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
** you may not use this file except in compliance with the License. 
** You may obtain a copy of the License at 
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

#ifndef SkUserConfig_DEFINED
#define SkUserConfig_DEFINED

// remove the x if you want to force us into SK_DEBUG mode
#ifdef SK_RELEASEx
    #undef SK_RELEASE
    #define SK_DEBUG
#endif

#ifdef ANDROID
    #include <utils/misc.h>

#if 0
    // force fixed
    #define SK_SCALAR_IS_FIXED
    #undef  SK_SCALAR_IS_FLOAT
#else
    // force floats
    #ifdef SK_SCALAR_IS_FIXED
        #undef  SK_SCALAR_IS_FIXED
    #endif
    #define SK_SCALAR_IS_FLOAT
#endif

    #define SK_CAN_USE_FLOAT
    #define SkLONGLONG int64_t

    #if __BYTE_ORDER == __BIG_ENDIAN
        #define SK_CPU_BENDIAN
        #undef  SK_CPU_LENDIAN
    #else
        #define SK_CPU_LENDIAN
        #undef  SK_CPU_BENDIAN
    #endif

    // define SkDebugf to record file/line
    #define SkDebugf(...) Android_SkDebugf(__FILE__, __LINE__, \
                                           __FUNCTION__, __VA_ARGS__)
    void Android_SkDebugf(const char* file, int line, 
                          const char* function, const char* format, ...);
#endif

/*  This file is included before all other headers, except for SkPreConfig.h.
    That file uses various heuristics to make a "best guess" at settings for
    the following build defines.

    However, in this file you can override any of those decisions by either
    defining new symbols, or #undef symbols that were already set.
*/

// experimental for now
#define SK_SUPPORT_MIPMAP

#ifdef SK_DEBUG
    #define SK_SUPPORT_UNITTEST
    /* Define SK_SIMULATE_FAILED_MALLOC to have
     * sk_malloc throw an exception. Use this to
     * detect unhandled memory leaks. */
    //#define SK_SIMULATE_FAILED_MALLOC
    //#define SK_FIND_MEMORY_LEAKS
#endif

#ifdef SK_BUILD_FOR_BREW
    #include "SkBrewUserConfig.h"
#endif

// ===== Begin Chrome-specific definitions =====

#define SK_SCALAR_IS_FLOAT
#undef SK_SCALAR_IS_FIXED

#define SK_BUILD_FOR_WIN

// VC8 doesn't support stdint.h, so we define those types here.
#define SK_IGNORE_STDINT_DOT_H
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned uint32_t;

// Don't use skia debug mode even when compiled as debug, because we don't
// care about debugging this library, only our app.
#undef SK_DEBUG
#undef SK_SUPPORT_UNITTEST
#define SK_RELEASE
#undef SK_RESTRICT
#define SK_RESTRICT
// Skia uses this deprecated bzero function to fill zeros into a string.
#define bzero(str, len) memset(str, 0, len)
#define SkDebugf(...)  ((void)0)
#define SK_A32_SHIFT    24
#define SK_R32_SHIFT    16
#define SK_G32_SHIFT    8
#define SK_B32_SHIFT    0

// ===== End Chrome-specific definitions =====

#endif