blob: 057bc83d19b06687c24000703010f0b7fadf8983 [file] [log] [blame]
bsalomon682c2692015-05-22 14:01:46 -07001/*
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 {
bsalomon4ee6bd82015-05-27 13:23:23 -070014 GrContextOptions()
15 : fDrawPathToCompressedTexture(false)
16 , fSuppressPrints(false)
cdalton6fd158e2015-05-27 15:08:33 -070017 , fMaxTextureSizeOverride(SK_MaxS32)
bsalomonc59a1df2015-06-01 07:13:42 -070018 , fMinTextureSizeOverride(0)
joshualitt7224c862015-05-29 06:46:47 -070019 , fSuppressDualSourceBlending(false)
joshualitte5b74c62015-06-01 14:17:47 -070020 , fGeometryBufferMapThreshold(-1) {}
bsalomon682c2692015-05-22 14:01:46 -070021
22 // EXPERIMENTAL
23 // May be removed in the future, or may become standard depending
24 // on the outcomes of a variety of internal tests.
25 bool fDrawPathToCompressedTexture;
bsalomon4ee6bd82015-05-27 13:23:23 -070026
bsalomon682c2692015-05-22 14:01:46 -070027 // Suppress prints for the GrContext.
28 bool fSuppressPrints;
bsalomon4ee6bd82015-05-27 13:23:23 -070029
30 /** Overrides: These options override feature detection using backend API queries. These
31 overrides can only reduce the feature set or limits, never increase them beyond the
32 detected values. */
33
cdalton6fd158e2015-05-27 15:08:33 -070034 int fMaxTextureSizeOverride;
bsalomonc59a1df2015-06-01 07:13:42 -070035 int fMinTextureSizeOverride;
cdalton6fd158e2015-05-27 15:08:33 -070036 bool fSuppressDualSourceBlending;
joshualitt7224c862015-05-29 06:46:47 -070037
joshualitte5b74c62015-06-01 14:17:47 -070038 /** the threshold in bytes above which we will use a buffer mapping API to map vertex and index
39 buffers to CPU memory in order to update them. A value of -1 means the GrContext should
40 deduce the optimal value for this platform. */
41 int fGeometryBufferMapThreshold;
bsalomon682c2692015-05-22 14:01:46 -070042};
43
44#endif