OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef GrDrawTargetCaps_DEFINED | 8 #ifndef GrDrawTargetCaps_DEFINED |
9 #define GrDrawTargetCaps_DEFINED | 9 #define GrDrawTargetCaps_DEFINED |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 """ | 49 """ |
50 If the smallest representable value greater than 1 is 1 + e, the
n fBits will | 50 If the smallest representable value greater than 1 is 1 + e, the
n fBits will |
51 contain floor(log2(e)), and every value in the range [2^fLogRang
eLow, | 51 contain floor(log2(e)), and every value in the range [2^fLogRang
eLow, |
52 2^fLogRangeHigh] can be represented to at least one part in 2^fB
its. | 52 2^fLogRangeHigh] can be represented to at least one part in 2^fB
its. |
53 """ | 53 """ |
54 */ | 54 */ |
55 int fBits; | 55 int fBits; |
56 }; | 56 }; |
57 | 57 |
58 | 58 |
59 GrDrawTargetCaps() : fUniqueID(CreateUniqueID()) { | 59 GrDrawTargetCaps() { |
60 this->reset(); | 60 this->reset(); |
61 } | 61 } |
62 GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED(), fUniqueID(Cre
ateUniqueID()) { | 62 GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { |
63 *this = other; | 63 *this = other; |
64 } | 64 } |
65 GrDrawTargetCaps& operator= (const GrDrawTargetCaps&); | 65 GrDrawTargetCaps& operator= (const GrDrawTargetCaps&); |
66 | 66 |
67 virtual void reset(); | 67 virtual void reset(); |
68 virtual SkString dump() const; | 68 virtual SkString dump() const; |
69 | 69 |
70 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } | 70 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } |
71 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. | 71 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. |
72 only for POT textures) */ | 72 only for POT textures) */ |
73 bool mipMapSupport() const { return fMipMapSupport; } | 73 bool mipMapSupport() const { return fMipMapSupport; } |
74 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } | 74 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } |
75 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } | 75 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } |
76 bool hwAALineSupport() const { return fHWAALineSupport; } | |
77 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } | 76 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } |
78 bool geometryShaderSupport() const { return fGeometryShaderSupport; } | 77 bool geometryShaderSupport() const { return fGeometryShaderSupport; } |
79 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport;
} | 78 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport;
} |
80 bool pathRenderingSupport() const { return fPathRenderingSupport; } | 79 bool pathRenderingSupport() const { return fPathRenderingSupport; } |
81 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } | 80 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
82 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } | 81 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } |
83 #if GR_FORCE_GPU_TRACE_DEBUGGING | 82 #if GR_FORCE_GPU_TRACE_DEBUGGING |
84 bool gpuTracingSupport() const { return true; } | 83 bool gpuTracingSupport() const { return true; } |
85 #else | 84 #else |
86 bool gpuTracingSupport() const { return fGpuTracingSupport; } | 85 bool gpuTracingSupport() const { return fGpuTracingSupport; } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return fFloatPrecisions[shaderType][precision]; | 135 return fFloatPrecisions[shaderType][precision]; |
137 }; | 136 }; |
138 | 137 |
139 /** | 138 /** |
140 * Is there any difference between the float shader variable precision types
? If this is true | 139 * Is there any difference between the float shader variable precision types
? If this is true |
141 * then unless the shader type is not supported, any call to getFloatShaderP
recisionInfo() would | 140 * then unless the shader type is not supported, any call to getFloatShaderP
recisionInfo() would |
142 * report the same info for all precisions in all shader types. | 141 * report the same info for all precisions in all shader types. |
143 */ | 142 */ |
144 bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } | 143 bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } |
145 | 144 |
146 /** | |
147 * Gets an id that is unique for this GrDrawTargetCaps object. It is static
in that it does | |
148 * not change when the content of the GrDrawTargetCaps object changes. This
will never return | |
149 * 0. | |
150 */ | |
151 uint32_t getUniqueID() const { return fUniqueID; } | |
152 | |
153 protected: | 145 protected: |
154 bool fNPOTTextureTileSupport : 1; | 146 bool fNPOTTextureTileSupport : 1; |
155 bool fMipMapSupport : 1; | 147 bool fMipMapSupport : 1; |
156 bool fTwoSidedStencilSupport : 1; | 148 bool fTwoSidedStencilSupport : 1; |
157 bool fStencilWrapOpsSupport : 1; | 149 bool fStencilWrapOpsSupport : 1; |
158 bool fHWAALineSupport : 1; | |
159 bool fShaderDerivativeSupport : 1; | 150 bool fShaderDerivativeSupport : 1; |
160 bool fGeometryShaderSupport : 1; | 151 bool fGeometryShaderSupport : 1; |
161 bool fDualSourceBlendingSupport : 1; | 152 bool fDualSourceBlendingSupport : 1; |
162 bool fPathRenderingSupport : 1; | 153 bool fPathRenderingSupport : 1; |
163 bool fDstReadInShaderSupport : 1; | 154 bool fDstReadInShaderSupport : 1; |
164 bool fDiscardRenderTargetSupport : 1; | 155 bool fDiscardRenderTargetSupport : 1; |
165 bool fReuseScratchTextures : 1; | 156 bool fReuseScratchTextures : 1; |
166 bool fGpuTracingSupport : 1; | 157 bool fGpuTracingSupport : 1; |
167 bool fCompressedTexSubImageSupport : 1; | 158 bool fCompressedTexSubImageSupport : 1; |
168 bool fOversizedStencilSupport : 1; | 159 bool fOversizedStencilSupport : 1; |
169 // Driver workaround | 160 // Driver workaround |
170 bool fUseDrawInsteadOfClear : 1; | 161 bool fUseDrawInsteadOfClear : 1; |
171 | 162 |
172 uint32_t fMapBufferFlags; | 163 uint32_t fMapBufferFlags; |
173 | 164 |
174 int fMaxRenderTargetSize; | 165 int fMaxRenderTargetSize; |
175 int fMaxTextureSize; | 166 int fMaxTextureSize; |
176 int fMaxSampleCount; | 167 int fMaxSampleCount; |
177 | 168 |
178 // The first entry for each config is without msaa and the second is with. | 169 // The first entry for each config is without msaa and the second is with. |
179 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 170 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
180 bool fConfigTextureSupport[kGrPixelConfigCnt]; | 171 bool fConfigTextureSupport[kGrPixelConfigCnt]; |
181 | 172 |
182 bool fShaderPrecisionVaries; | 173 bool fShaderPrecisionVaries; |
183 PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; | 174 PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; |
184 | 175 |
185 private: | 176 private: |
186 static uint32_t CreateUniqueID(); | |
187 | |
188 const uint32_t fUniqueID; | |
189 | |
190 typedef SkRefCnt INHERITED; | 177 typedef SkRefCnt INHERITED; |
191 }; | 178 }; |
192 | 179 |
193 #endif | 180 #endif |
OLD | NEW |