GrContextOptions.h revision 6dea83f244cfdea52901eef6b31cee60b07a8ea0
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 13struct GrContextOptions { 14 GrContextOptions() 15 : fDrawPathToCompressedTexture(false) 16 , fSuppressPrints(false) 17 , fMaxTextureSizeOverride(SK_MaxS32) 18 , fMaxTileSizeOverride(0) 19 , fSuppressDualSourceBlending(false) 20 , fGeometryBufferMapThreshold(-1) 21 , fUseDrawInsteadOfPartialRenderTargetWrite(false) 22 , fImmediateMode(false) 23 , fClipBatchToBounds(false) 24 , fDrawBatchBounds(false) 25 , fUseShaderSwizzling(false) {} 26 27 // EXPERIMENTAL 28 // May be removed in the future, or may become standard depending 29 // on the outcomes of a variety of internal tests. 30 bool fDrawPathToCompressedTexture; 31 32 // Suppress prints for the GrContext. 33 bool fSuppressPrints; 34 35 /** Overrides: These options override feature detection using backend API queries. These 36 overrides can only reduce the feature set or limits, never increase them beyond the 37 detected values. */ 38 39 int fMaxTextureSizeOverride; 40 /** If non-zero, overrides the maximum size of a tile for sw-backed images and bitmaps rendered 41 by SkGpuDevice. */ 42 int fMaxTileSizeOverride; 43 bool fSuppressDualSourceBlending; 44 45 /** the threshold in bytes above which we will use a buffer mapping API to map vertex and index 46 buffers to CPU memory in order to update them. A value of -1 means the GrContext should 47 deduce the optimal value for this platform. */ 48 int fGeometryBufferMapThreshold; 49 50 /** some gpus have problems with partial writes of the rendertarget */ 51 bool fUseDrawInsteadOfPartialRenderTargetWrite; 52 53 /** The GrContext operates in immediate mode. It will issue all draws to the backend API 54 immediately. Intended to ease debugging. */ 55 bool fImmediateMode; 56 57 /** For debugging purposes turn each GrBatch's bounds into a clip rect. This is used to 58 verify that the clip bounds are conservative. */ 59 bool fClipBatchToBounds; 60 61 /** For debugging purposes draw a wireframe device bounds rect for each GrBatch. The wire 62 frame rect is draw before the GrBatch in order to visualize batches that draw outside 63 of their dev bounds. */ 64 bool fDrawBatchBounds; 65 66 /** Force us to do all swizzling manually in the shader and don't rely on extensions to do 67 swizzling. */ 68 bool fUseShaderSwizzling; 69}; 70 71#endif 72