epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2010 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 9 | #ifndef GrConfig_DEFINED |
| 10 | #define GrConfig_DEFINED |
| 11 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 12 | #include "include/core/SkTypes.h" |
robertphillips@google.com | 5955202 | 2012-08-31 13:07:37 +0000 | [diff] [blame] | 13 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 14 | /** |
| 15 | * Gr defines are set to 0 or 1, rather than being undefined or defined |
| 16 | */ |
| 17 | |
robertphillips@google.com | 5955202 | 2012-08-31 13:07:37 +0000 | [diff] [blame] | 18 | #if !defined(GR_CACHE_STATS) |
djsollen | efe46d2 | 2016-04-29 06:41:35 -0700 | [diff] [blame] | 19 | #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) |
bsalomon | 24234fe | 2014-10-24 09:34:41 -0700 | [diff] [blame] | 20 | #define GR_CACHE_STATS 1 |
| 21 | #else |
| 22 | #define GR_CACHE_STATS 0 |
| 23 | #endif |
robertphillips@google.com | 5955202 | 2012-08-31 13:07:37 +0000 | [diff] [blame] | 24 | #endif |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 25 | |
robertphillips | 754f4e9 | 2014-09-18 13:52:08 -0700 | [diff] [blame] | 26 | #if !defined(GR_GPU_STATS) |
Greg Daniel | d207345 | 2018-12-07 11:20:33 -0500 | [diff] [blame] | 27 | #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || defined(GR_TEST_UTILS) |
bsalomon | 24234fe | 2014-10-24 09:34:41 -0700 | [diff] [blame] | 28 | #define GR_GPU_STATS 1 |
| 29 | #else |
| 30 | #define GR_GPU_STATS 0 |
| 31 | #endif |
robertphillips | 754f4e9 | 2014-09-18 13:52:08 -0700 | [diff] [blame] | 32 | #endif |
| 33 | |
senorblanco@chromium.org | f9a1455 | 2012-11-06 18:36:33 +0000 | [diff] [blame] | 34 | #endif |
bsalomon@google.com | 9182610 | 2011-03-21 19:51:57 +0000 | [diff] [blame] | 35 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 36 | /** |
| 37 | * GR_STRING makes a string of X where X is expanded before conversion to a string |
| 38 | * if X itself contains macros. |
| 39 | */ |
| 40 | #define GR_STRING(X) GR_STRING_IMPL(X) |
| 41 | #define GR_STRING_IMPL(X) #X |
| 42 | |
| 43 | /** |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 44 | * GR_CONCAT concatenates X and Y where each is expanded before |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 45 | * contanenation if either contains macros. |
| 46 | */ |
| 47 | #define GR_CONCAT(X,Y) GR_CONCAT_IMPL(X,Y) |
| 48 | #define GR_CONCAT_IMPL(X,Y) X##Y |
| 49 | |
| 50 | /** |
| 51 | * Creates a string of the form "<filename>(<linenumber>) : " |
| 52 | */ |
| 53 | #define GR_FILE_AND_LINE_STR __FILE__ "(" GR_STRING(__LINE__) ") : " |