blob: d8d59fac3a89186a6705279f446ef5c2ca978271 [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)
joshualitt7224c862015-05-29 06:46:47 -070018 , fSuppressDualSourceBlending(false)
19 , fGeometryBufferMapThreshold(1 << 15) {}
bsalomon682c2692015-05-22 14:01:46 -070020
21 // EXPERIMENTAL
22 // May be removed in the future, or may become standard depending
23 // on the outcomes of a variety of internal tests.
24 bool fDrawPathToCompressedTexture;
bsalomon4ee6bd82015-05-27 13:23:23 -070025
bsalomon682c2692015-05-22 14:01:46 -070026 // Suppress prints for the GrContext.
27 bool fSuppressPrints;
bsalomon4ee6bd82015-05-27 13:23:23 -070028
29 /** Overrides: These options override feature detection using backend API queries. These
30 overrides can only reduce the feature set or limits, never increase them beyond the
31 detected values. */
32
cdalton6fd158e2015-05-27 15:08:33 -070033 int fMaxTextureSizeOverride;
34 bool fSuppressDualSourceBlending;
joshualitt7224c862015-05-29 06:46:47 -070035
36 /** fGeometryBufferMapThreshold gives a threshold (in bytes) for when Gr should
37 map a GrGeometryBuffer to update its contents. It will use map() if the
38 size of the updated region is greater than the threshold. Otherwise it will
39 use updateData(). */
40 size_t fGeometryBufferMapThreshold;
bsalomon682c2692015-05-22 14:01:46 -070041};
42
43#endif