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 , fMinTextureSizeOverride(0) | |
19 , fSuppressDualSourceBlending(false) | 18 , fSuppressDualSourceBlending(false) |
20 , fGeometryBufferMapThreshold(-1) | 19 , fGeometryBufferMapThreshold(-1) |
21 , fUseDrawInsteadOfPartialRenderTargetWrite(false) | 20 , fUseDrawInsteadOfPartialRenderTargetWrite(false) |
22 , fImmediateMode(false) {} | 21 , fImmediateMode(false) {} |
23 | 22 |
24 // EXPERIMENTAL | 23 // EXPERIMENTAL |
25 // May be removed in the future, or may become standard depending | 24 // May be removed in the future, or may become standard depending |
26 // on the outcomes of a variety of internal tests. | 25 // on the outcomes of a variety of internal tests. |
27 bool fDrawPathToCompressedTexture; | 26 bool fDrawPathToCompressedTexture; |
28 | 27 |
29 // Suppress prints for the GrContext. | 28 // Suppress prints for the GrContext. |
30 bool fSuppressPrints; | 29 bool fSuppressPrints; |
31 | 30 |
32 /** Overrides: These options override feature detection using backend API qu
eries. These | 31 /** Overrides: These options override feature detection using backend API qu
eries. These |
33 overrides can only reduce the feature set or limits, never increase them
beyond the | 32 overrides can only reduce the feature set or limits, never increase them
beyond the |
34 detected values. */ | 33 detected values. */ |
35 | 34 |
36 int fMaxTextureSizeOverride; | 35 int fMaxTextureSizeOverride; |
37 int fMinTextureSizeOverride; | |
38 bool fSuppressDualSourceBlending; | 36 bool fSuppressDualSourceBlending; |
39 | 37 |
40 /** the threshold in bytes above which we will use a buffer mapping API to m
ap vertex and index | 38 /** the threshold in bytes above which we will use a buffer mapping API to m
ap vertex and index |
41 buffers to CPU memory in order to update them. A value of -1 means the
GrContext should | 39 buffers to CPU memory in order to update them. A value of -1 means the
GrContext should |
42 deduce the optimal value for this platform. */ | 40 deduce the optimal value for this platform. */ |
43 int fGeometryBufferMapThreshold; | 41 int fGeometryBufferMapThreshold; |
44 | 42 |
45 /** some gpus have problems with partial writes of the rendertarget */ | 43 /** some gpus have problems with partial writes of the rendertarget */ |
46 bool fUseDrawInsteadOfPartialRenderTargetWrite; | 44 bool fUseDrawInsteadOfPartialRenderTargetWrite; |
47 | 45 |
48 /** The GrContext operates in immedidate mode. It will issue all draws to th
e backend API | 46 /** The GrContext operates in immedidate mode. It will issue all draws to th
e backend API |
49 immediately. Intended to ease debugging. */ | 47 immediately. Intended to ease debugging. */ |
50 bool fImmediateMode; | 48 bool fImmediateMode; |
51 }; | 49 }; |
52 | 50 |
53 #endif | 51 #endif |
OLD | NEW |