Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GrContextOptions.h
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 #include "GrTypes.h"
13 
15  GrContextOptions() {}
16 
17  // Suppress prints for the GrContext.
18  bool fSuppressPrints = false;
19 
24  int fMaxTextureSizeOverride = SK_MaxS32;
25 
29  bool fSuppressDualSourceBlending = false;
30 
35 
38 
41  bool fUseShaderSwizzling = false;
42 
46  bool fDoManualMipmapping = false;
47 
51 
56  bool fAllowPathMaskCaching = false;
57 
65 
71 
75  bool fSuppressPathRendering = false;
76 
80  bool fWireframeMode = false;
81 
85  enum class GpuPathRenderers {
86  kNone = 0, // Always use sofware masks.
87  kDashLine = 1 << 0,
88  kStencilAndCover = 1 << 1,
89  kMSAA = 1 << 2,
90  kAAHairline = 1 << 3,
91  kAAConvex = 1 << 4,
92  kAALinearizing = 1 << 5,
93  kSmall = 1 << 6,
94  kTessellating = 1 << 7,
95  kDefault = 1 << 8,
96 
97  kAll = kDefault | (kDefault - 1),
98 
99  // For legacy. To be removed when updated in Android.
100  kDistanceField = kSmall
101  };
102 
103  GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll;
104 
108  float fGlyphCacheTextureMaximumBytes = 2048 * 1024 * 4;
109 
114  bool fAvoidStencilBuffers = false;
115 };
116 
117 GR_MAKE_BITFIELD_CLASS_OPS(GrContextOptions::GpuPathRenderers)
118 
119 #endif
Definition: GrContextOptions.h:14
int fMaxTextureSizeOverride
Overrides: These options override feature detection using backend API queries.
Definition: GrContextOptions.h:24
bool fUseShaderSwizzling
Force us to do all swizzling manually in the shader and don't rely on extensions to do swizzling...
Definition: GrContextOptions.h:41
bool fSuppressPathRendering
If true, the caps will never report driver support for path rendering.
Definition: GrContextOptions.h:75
bool fUseDrawInsteadOfPartialRenderTargetWrite
some gpus have problems with partial writes of the rendertarget
Definition: GrContextOptions.h:37
bool fRequireDecodeDisableForSRGB
If true, sRGB support will not be enabled unless sRGB decoding can be disabled (via an extension)...
Definition: GrContextOptions.h:64
GpuPathRenderers
Allows the client to include or exclude specific GPU path renderers.
Definition: GrContextOptions.h:85
bool fAvoidStencilBuffers
Bugs on certain drivers cause stencil buffers to leak.
Definition: GrContextOptions.h:114
int fMaxTileSizeOverride
If non-zero, overrides the maximum size of a tile for sw-backed images and bitmaps rendered by SkGpuD...
Definition: GrContextOptions.h:28
bool fDoManualMipmapping
Construct mipmaps manually, via repeated downsampling draw-calls.
Definition: GrContextOptions.h:46
int fBufferMapThreshold
the threshold in bytes above which we will use a buffer mapping API to map vertex and index buffers t...
Definition: GrContextOptions.h:34
float fGlyphCacheTextureMaximumBytes
The maximum size of cache textures used for Skia's Glyph cache.
Definition: GrContextOptions.h:108
bool fWireframeMode
Render everything in wireframe.
Definition: GrContextOptions.h:80
bool fAllowPathMaskCaching
If true this allows path mask textures to be cached.
Definition: GrContextOptions.h:56
bool fDisableGpuYUVConversion
If true, the GPU will not be used to perform YUV -> RGB conversion when generating textures from code...
Definition: GrContextOptions.h:70
bool fEnableInstancedRendering
Enable instanced rendering as long as all required functionality is supported by the HW...
Definition: GrContextOptions.h:50