2008-12-17 15:59:43 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2006 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* SkTypes.h, the root of the public header files, does the following trick:
|
2011-01-28 22:19:22 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
#include "SkPreConfig.h"
|
|
|
|
#include "SkUserConfig.h"
|
|
|
|
#include "SkPostConfig.h"
|
2011-01-28 22:19:22 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
SkPreConfig.h runs first, and it is responsible for initializing certain
|
|
|
|
skia defines.
|
2011-01-28 22:19:22 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
SkPostConfig.h runs last, and its job is to just check that the final
|
|
|
|
defines are consistent (i.e. that we don't have mutually conflicting
|
|
|
|
defines).
|
2011-01-28 22:19:22 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
SkUserConfig.h (this file) runs in the middle. It gets to change or augment
|
|
|
|
the list of flags initially set in preconfig, and then postconfig checks
|
|
|
|
that everything still makes sense.
|
|
|
|
|
|
|
|
Below are optional defines that add, subtract, or change default behavior
|
|
|
|
in Skia. Your port can locally edit this file to enable/disable flags as
|
|
|
|
you choose, or these can be delared on your command line (i.e. -Dfoo).
|
|
|
|
|
|
|
|
By default, this include file will always default to having all of the flags
|
|
|
|
commented out, so including it will have no effect.
|
|
|
|
*/
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* Scalars (the fractional value type in skia) can be implemented either as
|
|
|
|
floats or 16.16 integers (fixed). Exactly one of these two symbols must be
|
|
|
|
defined.
|
|
|
|
*/
|
|
|
|
//#define SK_SCALAR_IS_FLOAT
|
|
|
|
//#define SK_SCALAR_IS_FIXED
|
2008-12-17 15:59:43 +00:00
|
|
|
|
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* Somewhat independent of how SkScalar is implemented, Skia also wants to know
|
|
|
|
if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined,
|
2011-05-17 17:36:59 +00:00
|
|
|
SK_CAN_USE_FLOAT must be too; but if scalars are fixed, SK_CAN_USE_FLOAT
|
2009-01-08 17:49:50 +00:00
|
|
|
can go either way.
|
|
|
|
*/
|
|
|
|
//#define SK_CAN_USE_FLOAT
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* For some performance-critical scalar operations, skia will optionally work
|
|
|
|
around the standard float operators if it knows that the CPU does not have
|
|
|
|
native support for floats. If your environment uses software floating point,
|
|
|
|
define this flag.
|
|
|
|
*/
|
|
|
|
//#define SK_SOFTWARE_FLOAT
|
2008-12-17 15:59:43 +00:00
|
|
|
|
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* Skia has lots of debug-only code. Often this is just null checks or other
|
|
|
|
parameter checking, but sometimes it can be quite intrusive (e.g. check that
|
|
|
|
each 32bit pixel is in premultiplied form). This code can be very useful
|
|
|
|
during development, but will slow things down in a shipping product.
|
2011-01-28 22:19:22 +00:00
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
By default, these mutually exclusive flags are defined in SkPreConfig.h,
|
|
|
|
based on the presence or absence of NDEBUG, but that decision can be changed
|
|
|
|
here.
|
|
|
|
*/
|
|
|
|
//#define SK_DEBUG
|
|
|
|
//#define SK_RELEASE
|
2008-12-17 15:59:43 +00:00
|
|
|
|
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
|
|
|
|
it will call SK_CRASH(). If this is not defined it, it is defined in
|
|
|
|
SkPostConfig.h to write to an illegal address
|
|
|
|
*/
|
|
|
|
//#define SK_CRASH() *(int *)(uintptr_t)0 = 0
|
|
|
|
|
|
|
|
|
|
|
|
/* preconfig will have attempted to determine the endianness of the system,
|
|
|
|
but you can change these mutually exclusive flags here.
|
|
|
|
*/
|
|
|
|
//#define SK_CPU_BENDIAN
|
|
|
|
//#define SK_CPU_LENDIAN
|
|
|
|
|
|
|
|
|
|
|
|
/* Some compilers don't support long long for 64bit integers. If yours does
|
|
|
|
not, define this to the appropriate type.
|
|
|
|
*/
|
|
|
|
//#define SkLONGLONG int64_t
|
|
|
|
|
|
|
|
|
|
|
|
/* Some envorinments do not suport writable globals (eek!). If yours does not,
|
|
|
|
define this flag.
|
|
|
|
*/
|
|
|
|
//#define SK_USE_RUNTIME_GLOBALS
|
|
|
|
|
|
|
|
|
|
|
|
/* To write debug messages to a console, skia will call SkDebugf(...) following
|
|
|
|
printf conventions (e.g. const char* format, ...). If you want to redirect
|
|
|
|
this to something other than printf, define yours here
|
|
|
|
*/
|
|
|
|
//#define SkDebugf(...) MyFunction(__VA_ARGS__)
|
|
|
|
|
2011-06-27 16:44:46 +00:00
|
|
|
/**
|
|
|
|
* Used only for lcdtext, define this to pack glyphs using 8 bits per component
|
|
|
|
* instead of 5-6-5. This can increase fidelity with the native font scaler,
|
|
|
|
* but doubles the RAM used by the font cache.
|
2011-06-22 13:19:43 +00:00
|
|
|
*/
|
|
|
|
//#define SK_SUPPORT_888_TEXT
|
|
|
|
|
|
|
|
/* If defined, use CoreText instead of ATSUI on OS X.
|
|
|
|
*/
|
|
|
|
//#define SK_USE_MAC_CORE_TEXT
|
|
|
|
|
|
|
|
|
2010-12-01 22:17:20 +00:00
|
|
|
/* If zlib is available and you want to support the flate compression
|
|
|
|
algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
|
|
|
|
include path.
|
|
|
|
*/
|
2010-12-20 20:53:13 +00:00
|
|
|
//#define SK_ZLIB_INCLUDE <zlib.h>
|
2010-12-01 22:17:20 +00:00
|
|
|
|
2011-03-04 03:15:13 +00:00
|
|
|
/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow
|
|
|
|
them, but modern PDF interpreters should handle them just fine.
|
|
|
|
*/
|
|
|
|
//#define SK_ALLOW_LARGE_PDF_SCALARS
|
|
|
|
|
2011-07-26 02:11:41 +00:00
|
|
|
/* Define this to provide font subsetter in PDF generation.
|
|
|
|
*/
|
|
|
|
//#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h"
|
|
|
|
|
2011-01-28 22:19:22 +00:00
|
|
|
/* Define this to remove dimension checks on bitmaps. Not all blits will be
|
|
|
|
correct yet, so this is mostly for debugging the implementation.
|
|
|
|
*/
|
|
|
|
//#define SK_ALLOW_OVER_32K_BITMAPS
|
|
|
|
|
2009-01-08 17:49:50 +00:00
|
|
|
/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
|
|
|
|
which will run additional self-tests at startup. These can take a long time,
|
|
|
|
so this flag is optional.
|
|
|
|
*/
|
|
|
|
#ifdef SK_DEBUG
|
2009-10-13 13:33:16 +00:00
|
|
|
//#define SK_SUPPORT_UNITTEST
|
2008-12-17 15:59:43 +00:00
|
|
|
#endif
|
|
|
|
|
2011-07-01 17:08:26 +00:00
|
|
|
/* If your system embeds skia and has complex event logging, define this
|
|
|
|
symbol to name a file that maps the following macros to your system's
|
2011-06-30 19:37:01 +00:00
|
|
|
equivalents:
|
|
|
|
SK_TRACE_EVENT0(event)
|
|
|
|
SK_TRACE_EVENT1(event, name1, value1)
|
|
|
|
SK_TRACE_EVENT2(event, name1, value1, name2, value2)
|
|
|
|
src/utils/SkDebugTrace.h has a trivial implementation that writes to
|
2011-07-01 17:08:26 +00:00
|
|
|
the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined,
|
|
|
|
SkTrace.h will define the above three macros to do nothing.
|
2011-06-30 19:37:01 +00:00
|
|
|
*/
|
2011-07-01 17:08:26 +00:00
|
|
|
//#undef SK_USER_TRACE_INCLUDE_FILE
|
2011-06-30 19:37:01 +00:00
|
|
|
|
2011-03-18 21:43:03 +00:00
|
|
|
/* Change the ordering to work in X windows.
|
|
|
|
*/
|
|
|
|
#ifdef SK_SAMPLES_FOR_X
|
|
|
|
#define SK_R32_SHIFT 16
|
|
|
|
#define SK_G32_SHIFT 8
|
|
|
|
#define SK_B32_SHIFT 0
|
|
|
|
#define SK_A32_SHIFT 24
|
|
|
|
#endif
|
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
#endif
|