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 GrCaps_DEFINED | 8 #ifndef GrCaps_DEFINED |
9 #define GrCaps_DEFINED | 9 #define GrCaps_DEFINED |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 /** | 127 /** |
128 * Represents the capabilities of a GrContext. | 128 * Represents the capabilities of a GrContext. |
129 */ | 129 */ |
130 class GrCaps : public SkRefCnt { | 130 class GrCaps : public SkRefCnt { |
131 public: | 131 public: |
132 GrCaps(const GrContextOptions&); | 132 GrCaps(const GrContextOptions&); |
133 | 133 |
134 virtual SkString dump() const; | 134 virtual SkString dump() const; |
135 | 135 |
136 GrShaderCaps* shaderCaps() const { return fShaderCaps; } | 136 GrShaderCaps* shaderCaps() const { return fShaderCaps.get(); } |
137 | 137 |
138 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } | 138 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } |
139 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. | 139 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. |
140 only for POT textures) */ | 140 only for POT textures) */ |
141 bool mipMapSupport() const { return fMipMapSupport; } | 141 bool mipMapSupport() const { return fMipMapSupport; } |
142 | 142 |
143 /** | 143 /** |
144 * Skia convention is that a device only has sRGB support if it supports sRG
B formats for both | 144 * Skia convention is that a device only has sRGB support if it supports sRG
B formats for both |
145 * textures and framebuffers. In addition: | 145 * textures and framebuffers. In addition: |
146 * Decoding to linear of an sRGB texture can be disabled. | 146 * Decoding to linear of an sRGB texture can be disabled. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 bool sampleShadingSupport() const { return fSampleShadingSupport; } | 287 bool sampleShadingSupport() const { return fSampleShadingSupport; } |
288 | 288 |
289 bool fenceSyncSupport() const { return fFenceSyncSupport; } | 289 bool fenceSyncSupport() const { return fFenceSyncSupport; } |
290 | 290 |
291 protected: | 291 protected: |
292 /** Subclasses must call this at the end of their constructors in order to a
pply caps | 292 /** Subclasses must call this at the end of their constructors in order to a
pply caps |
293 overrides requested by the client. Note that overrides will only reduce
the caps never | 293 overrides requested by the client. Note that overrides will only reduce
the caps never |
294 expand them. */ | 294 expand them. */ |
295 void applyOptionsOverrides(const GrContextOptions& options); | 295 void applyOptionsOverrides(const GrContextOptions& options); |
296 | 296 |
297 SkAutoTUnref<GrShaderCaps> fShaderCaps; | 297 sk_sp<GrShaderCaps> fShaderCaps; |
298 | 298 |
299 bool fNPOTTextureTileSupport : 1; | 299 bool fNPOTTextureTileSupport : 1; |
300 bool fMipMapSupport : 1; | 300 bool fMipMapSupport : 1; |
301 bool fSRGBSupport : 1; | 301 bool fSRGBSupport : 1; |
302 bool fSRGBWriteControl : 1; | 302 bool fSRGBWriteControl : 1; |
303 bool fTwoSidedStencilSupport : 1; | 303 bool fTwoSidedStencilSupport : 1; |
304 bool fStencilWrapOpsSupport : 1; | 304 bool fStencilWrapOpsSupport : 1; |
305 bool fDiscardRenderTargetSupport : 1; | 305 bool fDiscardRenderTargetSupport : 1; |
306 bool fReuseScratchTextures : 1; | 306 bool fReuseScratchTextures : 1; |
307 bool fReuseScratchBuffers : 1; | 307 bool fReuseScratchBuffers : 1; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 private: | 350 private: |
351 virtual void onApplyOptionsOverrides(const GrContextOptions&) {} | 351 virtual void onApplyOptionsOverrides(const GrContextOptions&) {} |
352 | 352 |
353 bool fSuppressPrints : 1; | 353 bool fSuppressPrints : 1; |
354 bool fImmediateFlush: 1; | 354 bool fImmediateFlush: 1; |
355 | 355 |
356 typedef SkRefCnt INHERITED; | 356 typedef SkRefCnt INHERITED; |
357 }; | 357 }; |
358 | 358 |
359 #endif | 359 #endif |
OLD | NEW |