Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: skia/config/SkUserConfig.h

Issue 10806077: Upstream the rest of skia diff (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address the comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | skia/ext/image_operations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 The Android Open Source Project 2 * Copyright (C) 2006 The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with 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 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17 #ifndef SkUserConfig_DEFINED 17 #ifndef SkUserConfig_DEFINED
18 #define SkUserConfig_DEFINED 18 #define SkUserConfig_DEFINED
19 19
20 /* SkTypes.h, the root of the public header files, does the following trick: 20 /* SkTypes.h, the root of the public header files, does the following trick:
21 21
22 #include <SkPreConfig.h> 22 #include <SkPreConfig.h>
23 #include <SkUserConfig.h> 23 #include <SkUserConfig.h>
24 #include <SkPostConfig.h> 24 #include <SkPostConfig.h>
25 25
26 SkPreConfig.h runs first, and it is responsible for initializing certain 26 SkPreConfig.h runs first, and it is responsible for initializing certain
27 skia defines. 27 skia defines.
28 28
29 SkPostConfig.h runs last, and its job is to just check that the final 29 SkPostConfig.h runs last, and its job is to just check that the final
30 defines are consistent (i.e. that we don't have mutually conflicting 30 defines are consistent (i.e. that we don't have mutually conflicting
31 defines). 31 defines).
32 32
33 SkUserConfig.h (this file) runs in the middle. It gets to change or augment 33 SkUserConfig.h (this file) runs in the middle. It gets to change or augment
34 the list of flags initially set in preconfig, and then postconfig checks 34 the list of flags initially set in preconfig, and then postconfig checks
35 that everything still makes sense. 35 that everything still makes sense.
36 36
37 Below are optional defines that add, subtract, or change default behavior 37 Below are optional defines that add, subtract, or change default behavior
38 in Skia. Your port can locally edit this file to enable/disable flags as 38 in Skia. Your port can locally edit this file to enable/disable flags as
39 you choose, or these can be delared on your command line (i.e. -Dfoo). 39 you choose, or these can be delared on your command line (i.e. -Dfoo).
40 40
41 By default, this include file will always default to having all of the flags 41 By default, this include file will always default to having all of the flags
42 commented out, so including it will have no effect. 42 commented out, so including it will have no effect.
(...skipping 21 matching lines...) Expand all
64 native support for floats. If your environment uses software floating point, 64 native support for floats. If your environment uses software floating point,
65 define this flag. 65 define this flag.
66 */ 66 */
67 //#define SK_SOFTWARE_FLOAT 67 //#define SK_SOFTWARE_FLOAT
68 68
69 69
70 /* Skia has lots of debug-only code. Often this is just null checks or other 70 /* Skia has lots of debug-only code. Often this is just null checks or other
71 parameter checking, but sometimes it can be quite intrusive (e.g. check that 71 parameter checking, but sometimes it can be quite intrusive (e.g. check that
72 each 32bit pixel is in premultiplied form). This code can be very useful 72 each 32bit pixel is in premultiplied form). This code can be very useful
73 during development, but will slow things down in a shipping product. 73 during development, but will slow things down in a shipping product.
74 74
75 By default, these mutually exclusive flags are defined in SkPreConfig.h, 75 By default, these mutually exclusive flags are defined in SkPreConfig.h,
76 based on the presence or absence of NDEBUG, but that decision can be changed 76 based on the presence or absence of NDEBUG, but that decision can be changed
77 here. 77 here.
78 */ 78 */
79 //#define SK_DEBUG 79 //#define SK_DEBUG
80 //#define SK_RELEASE 80 //#define SK_RELEASE
81 81
82 82
83 /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) 83 /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
84 it will call SK_CRASH(). If this is not defined it, it is defined in 84 it will call SK_CRASH(). If this is not defined it, it is defined in
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal, 179 SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
180 const char* format, ...); 180 const char* format, ...);
181 181
182 // Marking the debug print as "fatal" will cause a debug break, so we don't need 182 // Marking the debug print as "fatal" will cause a debug break, so we don't need
183 // a separate crash call here. 183 // a separate crash call here.
184 #define SK_DEBUGBREAK(cond) do { if (!(cond)) { \ 184 #define SK_DEBUGBREAK(cond) do { if (!(cond)) { \
185 SkDebugf_FileLine(__FILE__, __LINE__, true, \ 185 SkDebugf_FileLine(__FILE__, __LINE__, true, \
186 "%s:%d: failed assertion \"%s\"\n", \ 186 "%s:%d: failed assertion \"%s\"\n", \
187 __FILE__, __LINE__, #cond); } } while (false) 187 __FILE__, __LINE__, #cond); } } while (false)
188 188
189 // All little-endian Chrome platforms agree: BGRA is the optimal pixel layout. 189 #if !defined(ANDROID) // On Android, we use the skia default settings.
190 #define SK_A32_SHIFT 24 190 #define SK_A32_SHIFT 24
191 #define SK_R32_SHIFT 16 191 #define SK_R32_SHIFT 16
192 #define SK_G32_SHIFT 8 192 #define SK_G32_SHIFT 8
193 #define SK_B32_SHIFT 0 193 #define SK_B32_SHIFT 0
194 #endif
194 195
195 #if defined(SK_BUILD_FOR_WIN32) 196 #if defined(SK_BUILD_FOR_WIN32)
196 197
197 #define SK_BUILD_FOR_WIN 198 #define SK_BUILD_FOR_WIN
198 199
199 // VC8 doesn't support stdint.h, so we define those types here. 200 // VC8 doesn't support stdint.h, so we define those types here.
200 #define SK_IGNORE_STDINT_DOT_H 201 #define SK_IGNORE_STDINT_DOT_H
201 typedef signed char int8_t; 202 typedef signed char int8_t;
202 typedef unsigned char uint8_t; 203 typedef unsigned char uint8_t;
203 typedef short int16_t; 204 typedef short int16_t;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // assertion. 243 // assertion.
243 #define SK_CRASH() SkDebugf_FileLine(__FILE__, __LINE__, true, "SK_CRASH") 244 #define SK_CRASH() SkDebugf_FileLine(__FILE__, __LINE__, true, "SK_CRASH")
244 245
245 // Uncomment the following line to forward skia trace events to Chrome 246 // Uncomment the following line to forward skia trace events to Chrome
246 // tracing. 247 // tracing.
247 // #define SK_USER_TRACE_INCLUDE_FILE "skia/ext/skia_trace_shim.h" 248 // #define SK_USER_TRACE_INCLUDE_FILE "skia/ext/skia_trace_shim.h"
248 249
249 // ===== End Chrome-specific definitions ===== 250 // ===== End Chrome-specific definitions =====
250 251
251 #endif 252 #endif
OLDNEW
« no previous file with comments | « no previous file | skia/ext/image_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698