OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 8 |
9 #ifndef GrGLSLCaps_DEFINED | 9 #ifndef GrGLSLCaps_DEFINED |
10 #define GrGLSLCaps_DEFINED | 10 #define GrGLSLCaps_DEFINED |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST ransform; } | 75 bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDST ransform; } |
76 | 76 |
77 // Returns the string of an extension that must be enabled in the shader to support | 77 // Returns the string of an extension that must be enabled in the shader to support |
78 // derivatives. If nullptr is returned then no extension needs to be enabled . Before calling | 78 // derivatives. If nullptr is returned then no extension needs to be enabled . Before calling |
79 // this function, the caller should check that shaderDerivativeSupport exist s. | 79 // this function, the caller should check that shaderDerivativeSupport exist s. |
80 const char* shaderDerivativeExtensionString() const { | 80 const char* shaderDerivativeExtensionString() const { |
81 SkASSERT(this->shaderDerivativeSupport()); | 81 SkASSERT(this->shaderDerivativeSupport()); |
82 return fShaderDerivativeExtensionString; | 82 return fShaderDerivativeExtensionString; |
83 } | 83 } |
84 | 84 |
85 bool mustSwizzleInShader() const { return fMustSwizzleInShader; } | |
86 | |
87 /** | |
88 * Returns a string which represents how to map from an internal GLFormat to a given | |
89 * GrPixelConfig. A draw side swizzle will then use this mapping to correctl y set components. | |
90 */ | |
91 const char* getSwizzleMap(GrPixelConfig config) const { return fConfigSwizzl e[config]; } | |
bsalomon
2015/11/03 14:45:51
Maybe change the last sentence to something like "
egdaniel
2015/11/03 15:23:56
Done.
| |
92 | |
85 GrGLSLGeneration generation() const { return fGLSLGeneration; } | 93 GrGLSLGeneration generation() const { return fGLSLGeneration; } |
86 | 94 |
87 /** | 95 /** |
88 * Returns a string containing the caps info. | 96 * Returns a string containing the caps info. |
89 */ | 97 */ |
90 SkString dump() const override; | 98 SkString dump() const override; |
91 | 99 |
92 private: | 100 private: |
101 void onApplyOptionsOverrides(const GrContextOptions& options) override; | |
102 | |
93 GrGLSLGeneration fGLSLGeneration; | 103 GrGLSLGeneration fGLSLGeneration; |
94 | 104 |
95 bool fDropsTileOnZeroDivide : 1; | 105 bool fDropsTileOnZeroDivide : 1; |
96 bool fFBFetchSupport : 1; | 106 bool fFBFetchSupport : 1; |
97 bool fFBFetchNeedsCustomOutput : 1; | 107 bool fFBFetchNeedsCustomOutput : 1; |
98 bool fBindlessTextureSupport : 1; | 108 bool fBindlessTextureSupport : 1; |
99 bool fUsesPrecisionModifiers : 1; | 109 bool fUsesPrecisionModifiers : 1; |
100 bool fCanUseAnyFunctionInShader : 1; | 110 bool fCanUseAnyFunctionInShader : 1; |
101 bool fForceHighPrecisionNDSTransform : 1; | 111 bool fForceHighPrecisionNDSTransform : 1; |
102 | 112 |
103 const char* fVersionDeclString; | 113 const char* fVersionDeclString; |
104 | 114 |
105 const char* fShaderDerivativeExtensionString; | 115 const char* fShaderDerivativeExtensionString; |
106 | 116 |
107 const char* fFBFetchColorName; | 117 const char* fFBFetchColorName; |
108 const char* fFBFetchExtensionString; | 118 const char* fFBFetchExtensionString; |
109 | 119 |
110 AdvBlendEqInteraction fAdvBlendEqInteraction; | 120 AdvBlendEqInteraction fAdvBlendEqInteraction; |
111 | 121 |
122 bool fMustSwizzleInShader; | |
123 const char* fConfigSwizzle[kGrPixelConfigCnt]; | |
124 | |
112 friend class GrGLCaps; // For initialization. | 125 friend class GrGLCaps; // For initialization. |
113 | 126 |
114 typedef GrShaderCaps INHERITED; | 127 typedef GrShaderCaps INHERITED; |
115 }; | 128 }; |
116 | 129 |
117 | 130 |
118 #endif | 131 #endif |
OLD | NEW |