blob: 858d33a1c81f1e5c690d597e8325e206a9f87b7d [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@google.comac10a2d2010-12-22 21:39:39 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * 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.comac10a2d2010-12-22 21:39:39 +00007 */
8
reed@google.comac10a2d2010-12-22 21:39:39 +00009#ifndef GrConfig_DEFINED
10#define GrConfig_DEFINED
11
Mike Kleinc0bd9f92019-04-23 12:05:21 -050012#include "include/core/SkTypes.h"
robertphillips@google.com59552022012-08-31 13:07:37 +000013
reed@google.comac10a2d2010-12-22 21:39:39 +000014/**
15 * Gr defines are set to 0 or 1, rather than being undefined or defined
16 */
17
robertphillips@google.com59552022012-08-31 13:07:37 +000018#if !defined(GR_CACHE_STATS)
djsollenefe46d22016-04-29 06:41:35 -070019 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
bsalomon24234fe2014-10-24 09:34:41 -070020 #define GR_CACHE_STATS 1
21 #else
22 #define GR_CACHE_STATS 0
23 #endif
robertphillips@google.com59552022012-08-31 13:07:37 +000024#endif
reed@google.comac10a2d2010-12-22 21:39:39 +000025
robertphillips754f4e92014-09-18 13:52:08 -070026#if !defined(GR_GPU_STATS)
Greg Danield2073452018-12-07 11:20:33 -050027 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || defined(GR_TEST_UTILS)
bsalomon24234fe2014-10-24 09:34:41 -070028 #define GR_GPU_STATS 1
29 #else
30 #define GR_GPU_STATS 0
31 #endif
robertphillips754f4e92014-09-18 13:52:08 -070032#endif
33
senorblanco@chromium.orgf9a14552012-11-06 18:36:33 +000034#endif
bsalomon@google.com91826102011-03-21 19:51:57 +000035
reed@google.comac10a2d2010-12-22 21:39:39 +000036/**
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.com1c13c962011-02-14 16:51:21 +000044 * GR_CONCAT concatenates X and Y where each is expanded before
reed@google.comac10a2d2010-12-22 21:39:39 +000045 * 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__) ") : "