OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrContextOptions_DEFINED | 8 #ifndef GrContextOptions_DEFINED |
9 #define GrContextOptions_DEFINED | 9 #define GrContextOptions_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 struct GrContextOptions { | 13 struct GrContextOptions { |
14 GrContextOptions() | 14 GrContextOptions() |
15 : fDrawPathToCompressedTexture(false) | 15 : fDrawPathToCompressedTexture(false) |
16 , fSuppressPrints(false) | 16 , fSuppressPrints(false) |
17 , fMaxTextureSizeOverride(SK_MaxS32) | 17 , fMaxTextureSizeOverride(SK_MaxS32) |
18 , fSuppressDualSourceBlending(false) {} | 18 , fSuppressDualSourceBlending(false) |
| 19 , fGeometryBufferMapThreshold(1 << 15) {} |
19 | 20 |
20 // EXPERIMENTAL | 21 // EXPERIMENTAL |
21 // May be removed in the future, or may become standard depending | 22 // May be removed in the future, or may become standard depending |
22 // on the outcomes of a variety of internal tests. | 23 // on the outcomes of a variety of internal tests. |
23 bool fDrawPathToCompressedTexture; | 24 bool fDrawPathToCompressedTexture; |
24 | 25 |
25 // Suppress prints for the GrContext. | 26 // Suppress prints for the GrContext. |
26 bool fSuppressPrints; | 27 bool fSuppressPrints; |
27 | 28 |
28 /** Overrides: These options override feature detection using backend API qu
eries. These | 29 /** Overrides: These options override feature detection using backend API qu
eries. These |
29 overrides can only reduce the feature set or limits, never increase them
beyond the | 30 overrides can only reduce the feature set or limits, never increase them
beyond the |
30 detected values. */ | 31 detected values. */ |
31 | 32 |
32 int fMaxTextureSizeOverride; | 33 int fMaxTextureSizeOverride; |
33 bool fSuppressDualSourceBlending; | 34 bool fSuppressDualSourceBlending; |
| 35 |
| 36 /** fGeometryBufferMapThreshold gives a threshold (in bytes) for when Gr sho
uld |
| 37 map a GrGeometryBuffer to update its contents. It will use map() if the |
| 38 size of the updated region is greater than the threshold. Otherwise it w
ill |
| 39 use updateData(). */ |
| 40 size_t fGeometryBufferMapThreshold; |
34 }; | 41 }; |
35 | 42 |
36 #endif | 43 #endif |
OLD | NEW |