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 : fSuppressPrints(false) | 15 : fSuppressPrints(false) |
16 , fMaxTextureSizeOverride(SK_MaxS32) | 16 , fMaxTextureSizeOverride(SK_MaxS32) |
17 , fMaxTileSizeOverride(0) | 17 , fMaxTileSizeOverride(0) |
18 , fSuppressDualSourceBlending(false) | 18 , fSuppressDualSourceBlending(false) |
19 , fBufferMapThreshold(-1) | 19 , fBufferMapThreshold(-1) |
20 , fUseDrawInsteadOfPartialRenderTargetWrite(false) | 20 , fUseDrawInsteadOfPartialRenderTargetWrite(false) |
21 , fImmediateMode(false) | 21 , fImmediateMode(false) |
22 , fClipBatchToBounds(false) | 22 , fClipBatchToBounds(false) |
23 , fDrawBatchBounds(false) | 23 , fDrawBatchBounds(false) |
24 , fMaxBatchLookback(-1) | 24 , fMaxBatchLookback(-1) |
25 , fMaxBatchLookahead(-1) | 25 , fMaxBatchLookahead(-1) |
26 , fUseShaderSwizzling(false) {} | 26 , fUseShaderSwizzling(false) |
| 27 , fDoManualMipmapping(false) {} |
27 | 28 |
28 // Suppress prints for the GrContext. | 29 // Suppress prints for the GrContext. |
29 bool fSuppressPrints; | 30 bool fSuppressPrints; |
30 | 31 |
31 /** Overrides: These options override feature detection using backend API qu
eries. These | 32 /** Overrides: These options override feature detection using backend API qu
eries. These |
32 overrides can only reduce the feature set or limits, never increase them
beyond the | 33 overrides can only reduce the feature set or limits, never increase them
beyond the |
33 detected values. */ | 34 detected values. */ |
34 | 35 |
35 int fMaxTextureSizeOverride; | 36 int fMaxTextureSizeOverride; |
36 /** If non-zero, overrides the maximum size of a tile for sw-backed images a
nd bitmaps rendered | 37 /** If non-zero, overrides the maximum size of a tile for sw-backed images a
nd bitmaps rendered |
(...skipping 23 matching lines...) Expand all Loading... |
60 bool fDrawBatchBounds; | 61 bool fDrawBatchBounds; |
61 | 62 |
62 /** For debugging, override the default maximum look-back or look-ahead wind
ow for GrBatch | 63 /** For debugging, override the default maximum look-back or look-ahead wind
ow for GrBatch |
63 combining. */ | 64 combining. */ |
64 int fMaxBatchLookback; | 65 int fMaxBatchLookback; |
65 int fMaxBatchLookahead; | 66 int fMaxBatchLookahead; |
66 | 67 |
67 /** Force us to do all swizzling manually in the shader and don't rely on ex
tensions to do | 68 /** Force us to do all swizzling manually in the shader and don't rely on ex
tensions to do |
68 swizzling. */ | 69 swizzling. */ |
69 bool fUseShaderSwizzling; | 70 bool fUseShaderSwizzling; |
| 71 |
| 72 /** Construct mipmaps manually, via repeated downsampling draw-calls. This i
s used when |
| 73 the driver's implementation (glGenerateMipmap) contains bugs. This requi
res mipmap |
| 74 level and LOD control (ie desktop or ES3). */ |
| 75 bool fDoManualMipmapping; |
70 }; | 76 }; |
71 | 77 |
72 #endif | 78 #endif |
OLD | NEW |