Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: include/gpu/GrCaps.h

Issue 1158433006: Store context options on caps. (Closed) Base URL: https://skia.googlesource.com/skia.git@onecaps
Patch Set: remove case statement accidentally checked in Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GrCaps_DEFINED 8 #ifndef GrCaps_DEFINED
9 #define GrCaps_DEFINED 9 #define GrCaps_DEFINED
10 10
11 #include "GrTypes.h" 11 #include "GrTypes.h"
12 #include "GrTypesPriv.h" 12 #include "GrTypesPriv.h"
13 #include "GrShaderVar.h" 13 #include "GrShaderVar.h"
14 #include "SkRefCnt.h" 14 #include "SkRefCnt.h"
15 #include "SkString.h" 15 #include "SkString.h"
16 16
17 struct GrContextOptions;
18
17 class GrShaderCaps : public SkRefCnt { 19 class GrShaderCaps : public SkRefCnt {
18 public: 20 public:
19 SK_DECLARE_INST_COUNT(GrShaderCaps) 21 SK_DECLARE_INST_COUNT(GrShaderCaps)
20 22
21 /** Info about shader variable precision within a given shader stage. That i s, this info 23 /** Info about shader variable precision within a given shader stage. That i s, this info
22 is relevant to a float (or vecNf) variable declared with a GrSLPrecision 24 is relevant to a float (or vecNf) variable declared with a GrSLPrecision
23 in a given GrShaderType. The info here is hoisted from the OpenGL spec. */ 25 in a given GrShaderType. The info here is hoisted from the OpenGL spec. */
24 struct PrecisionInfo { 26 struct PrecisionInfo {
25 PrecisionInfo() { 27 PrecisionInfo() {
26 fLogRangeLow = 0; 28 fLogRangeLow = 0;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 typedef SkRefCnt INHERITED; 98 typedef SkRefCnt INHERITED;
97 }; 99 };
98 100
99 /** 101 /**
100 * Represents the capabilities of a GrContext. 102 * Represents the capabilities of a GrContext.
101 */ 103 */
102 class GrCaps : public SkRefCnt { 104 class GrCaps : public SkRefCnt {
103 public: 105 public:
104 SK_DECLARE_INST_COUNT(GrCaps) 106 SK_DECLARE_INST_COUNT(GrCaps)
105 107
106 GrCaps(); 108 GrCaps(const GrContextOptions&);
107 109
108 virtual SkString dump() const; 110 virtual SkString dump() const;
109 111
110 GrShaderCaps* shaderCaps() const { return fShaderCaps; } 112 GrShaderCaps* shaderCaps() const { return fShaderCaps; }
111 113
112 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } 114 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; }
113 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor t of MIP Maps (e.g. 115 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor t of MIP Maps (e.g.
114 only for POT textures) */ 116 only for POT textures) */
115 bool mipMapSupport() const { return fMipMapSupport; } 117 bool mipMapSupport() const { return fMipMapSupport; }
116 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } 118 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { 181 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const {
180 SkASSERT(kGrPixelConfigCnt > config); 182 SkASSERT(kGrPixelConfigCnt > config);
181 return fConfigRenderSupport[config][withMSAA]; 183 return fConfigRenderSupport[config][withMSAA];
182 } 184 }
183 185
184 bool isConfigTexturable(GrPixelConfig config) const { 186 bool isConfigTexturable(GrPixelConfig config) const {
185 SkASSERT(kGrPixelConfigCnt > config); 187 SkASSERT(kGrPixelConfigCnt > config);
186 return fConfigTextureSupport[config]; 188 return fConfigTextureSupport[config];
187 } 189 }
188 190
191 bool suppressPrints() const { return fSupressPrints; }
192
193 bool drawPathMasksToCompressedTexturesSupport() const {
194 return fDrawPathMasksToCompressedTextureSupport; }
195
189 protected: 196 protected:
190 SkAutoTUnref<GrShaderCaps> fShaderCaps; 197 SkAutoTUnref<GrShaderCaps> fShaderCaps;
191 198
192 bool fNPOTTextureTileSupport : 1; 199 bool fNPOTTextureTileSupport : 1;
193 bool fMipMapSupport : 1; 200 bool fMipMapSupport : 1;
194 bool fTwoSidedStencilSupport : 1; 201 bool fTwoSidedStencilSupport : 1;
195 bool fStencilWrapOpsSupport : 1; 202 bool fStencilWrapOpsSupport : 1;
196 bool fDiscardRenderTargetSupport : 1; 203 bool fDiscardRenderTargetSupport : 1;
197 bool fReuseScratchTextures : 1; 204 bool fReuseScratchTextures : 1;
198 bool fGpuTracingSupport : 1; 205 bool fGpuTracingSupport : 1;
199 bool fCompressedTexSubImageSupport : 1; 206 bool fCompressedTexSubImageSupport : 1;
200 bool fOversizedStencilSupport : 1; 207 bool fOversizedStencilSupport : 1;
201 bool fTextureBarrierSupport : 1; 208 bool fTextureBarrierSupport : 1;
202 // Driver workaround 209 // Driver workaround
203 bool fUseDrawInsteadOfClear : 1; 210 bool fUseDrawInsteadOfClear : 1;
204 211
205 BlendEquationSupport fBlendEquationSupport; 212 BlendEquationSupport fBlendEquationSupport;
206 uint32_t fMapBufferFlags; 213 uint32_t fMapBufferFlags;
207 214
208 int fMaxRenderTargetSize; 215 int fMaxRenderTargetSize;
209 int fMaxTextureSize; 216 int fMaxTextureSize;
210 int fMaxSampleCount; 217 int fMaxSampleCount;
211 218
212 // The first entry for each config is without msaa and the second is with. 219 // The first entry for each config is without msaa and the second is with.
213 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; 220 bool fConfigRenderSupport[kGrPixelConfigCnt][2];
214 bool fConfigTextureSupport[kGrPixelConfigCnt]; 221 bool fConfigTextureSupport[kGrPixelConfigCnt];
215 222
216 private: 223 private:
224 bool fSupressPrints : 1;
225 bool fDrawPathMasksToCompressedTextureSupport : 1;
226
217 typedef SkRefCnt INHERITED; 227 typedef SkRefCnt INHERITED;
218 }; 228 };
219 229
220 #endif 230 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698