| 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 , fDoManualMipmapping(false) |
| 28 , fEnableInstancedRendering(false) {} |
| 28 | 29 |
| 29 // Suppress prints for the GrContext. | 30 // Suppress prints for the GrContext. |
| 30 bool fSuppressPrints; | 31 bool fSuppressPrints; |
| 31 | 32 |
| 32 /** Overrides: These options override feature detection using backend API qu
eries. These | 33 /** 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 | 34 overrides can only reduce the feature set or limits, never increase them
beyond the |
| 34 detected values. */ | 35 detected values. */ |
| 35 | 36 |
| 36 int fMaxTextureSizeOverride; | 37 int fMaxTextureSizeOverride; |
| 37 /** If non-zero, overrides the maximum size of a tile for sw-backed images a
nd bitmaps rendered | 38 /** If non-zero, overrides the maximum size of a tile for sw-backed images a
nd bitmaps rendered |
| (...skipping 28 matching lines...) Expand all Loading... |
| 66 int fMaxBatchLookahead; | 67 int fMaxBatchLookahead; |
| 67 | 68 |
| 68 /** Force us to do all swizzling manually in the shader and don't rely on ex
tensions to do | 69 /** Force us to do all swizzling manually in the shader and don't rely on ex
tensions to do |
| 69 swizzling. */ | 70 swizzling. */ |
| 70 bool fUseShaderSwizzling; | 71 bool fUseShaderSwizzling; |
| 71 | 72 |
| 72 /** Construct mipmaps manually, via repeated downsampling draw-calls. This i
s used when | 73 /** 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 the driver's implementation (glGenerateMipmap) contains bugs. This requi
res mipmap |
| 74 level and LOD control (ie desktop or ES3). */ | 75 level and LOD control (ie desktop or ES3). */ |
| 75 bool fDoManualMipmapping; | 76 bool fDoManualMipmapping; |
| 77 |
| 78 /** Enable instanced rendering as long as all required functionality is supp
orted by the HW. |
| 79 Instanced rendering is still experimental at this point and disabled by
default. */ |
| 80 bool fEnableInstancedRendering; |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 #endif | 83 #endif |
| OLD | NEW |