bsalomon | 682c269 | 2015-05-22 14:01:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrContextOptions_DEFINED |
| 9 | #define GrContextOptions_DEFINED |
| 10 | |
| 11 | #include "SkTypes.h" |
| 12 | |
| 13 | struct GrContextOptions { |
bsalomon | 4ee6bd8 | 2015-05-27 13:23:23 -0700 | [diff] [blame] | 14 | GrContextOptions() |
| 15 | : fDrawPathToCompressedTexture(false) |
| 16 | , fSuppressPrints(false) |
cdalton | 6fd158e | 2015-05-27 15:08:33 -0700 | [diff] [blame] | 17 | , fMaxTextureSizeOverride(SK_MaxS32) |
bsalomon | c59a1df | 2015-06-01 07:13:42 -0700 | [diff] [blame] | 18 | , fMinTextureSizeOverride(0) |
joshualitt | 7224c86 | 2015-05-29 06:46:47 -0700 | [diff] [blame] | 19 | , fSuppressDualSourceBlending(false) |
joshualitt | e5b74c6 | 2015-06-01 14:17:47 -0700 | [diff] [blame^] | 20 | , fGeometryBufferMapThreshold(-1) {} |
bsalomon | 682c269 | 2015-05-22 14:01:46 -0700 | [diff] [blame] | 21 | |
| 22 | // EXPERIMENTAL |
| 23 | // May be removed in the future, or may become standard depending |
| 24 | // on the outcomes of a variety of internal tests. |
| 25 | bool fDrawPathToCompressedTexture; |
bsalomon | 4ee6bd8 | 2015-05-27 13:23:23 -0700 | [diff] [blame] | 26 | |
bsalomon | 682c269 | 2015-05-22 14:01:46 -0700 | [diff] [blame] | 27 | // Suppress prints for the GrContext. |
| 28 | bool fSuppressPrints; |
bsalomon | 4ee6bd8 | 2015-05-27 13:23:23 -0700 | [diff] [blame] | 29 | |
| 30 | /** Overrides: These options override feature detection using backend API queries. These |
| 31 | overrides can only reduce the feature set or limits, never increase them beyond the |
| 32 | detected values. */ |
| 33 | |
cdalton | 6fd158e | 2015-05-27 15:08:33 -0700 | [diff] [blame] | 34 | int fMaxTextureSizeOverride; |
bsalomon | c59a1df | 2015-06-01 07:13:42 -0700 | [diff] [blame] | 35 | int fMinTextureSizeOverride; |
cdalton | 6fd158e | 2015-05-27 15:08:33 -0700 | [diff] [blame] | 36 | bool fSuppressDualSourceBlending; |
joshualitt | 7224c86 | 2015-05-29 06:46:47 -0700 | [diff] [blame] | 37 | |
joshualitt | e5b74c6 | 2015-06-01 14:17:47 -0700 | [diff] [blame^] | 38 | /** the threshold in bytes above which we will use a buffer mapping API to map vertex and index |
| 39 | buffers to CPU memory in order to update them. A value of -1 means the GrContext should |
| 40 | deduce the optimal value for this platform. */ |
| 41 | int fGeometryBufferMapThreshold; |
bsalomon | 682c269 | 2015-05-22 14:01:46 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | #endif |