| 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 GrGLCaps_DEFINED | 9 #ifndef GrGLCaps_DEFINED |
| 10 #define GrGLCaps_DEFINED | 10 #define GrGLCaps_DEFINED |
| 11 | 11 |
| 12 #include "SkTArray.h" | 12 #include "SkTArray.h" |
| 13 #include "SkTDArray.h" | 13 #include "SkTDArray.h" |
| 14 #include "GrGLStencilBuffer.h" | 14 #include "GrGLStencilBuffer.h" |
| 15 #include "GrDrawTarget.h" |
| 15 | 16 |
| 16 class GrGLContextInfo; | 17 class GrGLContextInfo; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * Stores some capabilities of a GL context. Most are determined by the GL | 20 * Stores some capabilities of a GL context. Most are determined by the GL |
| 20 * version and the extensions string. It also tracks formats that have passed | 21 * version and the extensions string. It also tracks formats that have passed |
| 21 * the FBO completeness test. | 22 * the FBO completeness test. |
| 22 */ | 23 */ |
| 23 class GrGLCaps { | 24 class GrGLCaps : public GrDrawTarget::Caps { |
| 24 public: | 25 public: |
| 25 typedef GrGLStencilBuffer::Format StencilFormat; | 26 typedef GrGLStencilBuffer::Format StencilFormat; |
| 26 | 27 |
| 27 /** | 28 /** |
| 28 * Represents a supported multisampling/coverage-sampling mode. | 29 * Represents a supported multisampling/coverage-sampling mode. |
| 29 */ | 30 */ |
| 30 struct MSAACoverageMode { | 31 struct MSAACoverageMode { |
| 31 // "Coverage samples" includes samples that actually have color, depth, | 32 // "Coverage samples" includes samples that actually have color, depth, |
| 32 // stencil, ... as well as those that don't (coverage only). All samples | 33 // stencil, ... as well as those that don't (coverage only). All samples |
| 33 // are coverage samples. (We're using the word "coverage sample" to | 34 // are coverage samples. (We're using the word "coverage sample" to |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 */ | 87 */ |
| 87 GrGLCaps(); | 88 GrGLCaps(); |
| 88 | 89 |
| 89 GrGLCaps(const GrGLCaps& caps); | 90 GrGLCaps(const GrGLCaps& caps); |
| 90 | 91 |
| 91 GrGLCaps& operator = (const GrGLCaps& caps); | 92 GrGLCaps& operator = (const GrGLCaps& caps); |
| 92 | 93 |
| 93 /** | 94 /** |
| 94 * Resets the caps such that nothing is supported. | 95 * Resets the caps such that nothing is supported. |
| 95 */ | 96 */ |
| 96 void reset(); | 97 virtual void reset() SK_OVERRIDE; |
| 97 | 98 |
| 98 /** | 99 /** |
| 99 * Initializes the GrGLCaps to the set of features supported in the current | 100 * Initializes the GrGLCaps to the set of features supported in the current |
| 100 * OpenGL context accessible via ctxInfo. | 101 * OpenGL context accessible via ctxInfo. |
| 101 */ | 102 */ |
| 102 void init(const GrGLContextInfo& ctxInfo, const GrGLInterface* interface); | 103 void init(const GrGLContextInfo& ctxInfo, const GrGLInterface* interface); |
| 103 | 104 |
| 104 /** | 105 /** |
| 105 * Call to note that a color config has been verified as a valid color | 106 * Call to note that a color config has been verified as a valid color |
| 106 * attachment. This may save future calls to glCheckFramebufferStatus | 107 * attachment. This may save future calls to glCheckFramebufferStatus |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 * desired sample count is rounded up the next supported coverage sample | 152 * desired sample count is rounded up the next supported coverage sample |
| 152 * count unless a it is larger than the max in which case it is rounded | 153 * count unless a it is larger than the max in which case it is rounded |
| 153 * down. Once a coverage sample count is decided, the supported mode with | 154 * down. Once a coverage sample count is decided, the supported mode with |
| 154 * the fewest color samples is chosen. | 155 * the fewest color samples is chosen. |
| 155 */ | 156 */ |
| 156 const MSAACoverageMode& getMSAACoverageMode(int desiredSampleCount) const; | 157 const MSAACoverageMode& getMSAACoverageMode(int desiredSampleCount) const; |
| 157 | 158 |
| 158 /** | 159 /** |
| 159 * Prints the caps info using GrPrintf. | 160 * Prints the caps info using GrPrintf. |
| 160 */ | 161 */ |
| 161 void print() const; | 162 virtual void print() const SK_OVERRIDE; |
| 162 | 163 |
| 163 /** | 164 /** |
| 164 * Gets an array of legal stencil formats. These formats are not guaranteed | 165 * Gets an array of legal stencil formats. These formats are not guaranteed |
| 165 * to be supported by the driver but are legal GLenum names given the GL | 166 * to be supported by the driver but are legal GLenum names given the GL |
| 166 * version and extensions supported. | 167 * version and extensions supported. |
| 167 */ | 168 */ |
| 168 const SkTArray<StencilFormat, true>& stencilFormats() const { | 169 const SkTArray<StencilFormat, true>& stencilFormats() const { |
| 169 return fStencilFormats; | 170 return fStencilFormats; |
| 170 } | 171 } |
| 171 | 172 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 bool fPackFlipYSupport : 1; | 302 bool fPackFlipYSupport : 1; |
| 302 bool fTextureUsageSupport : 1; | 303 bool fTextureUsageSupport : 1; |
| 303 bool fTexStorageSupport : 1; | 304 bool fTexStorageSupport : 1; |
| 304 bool fTextureRedSupport : 1; | 305 bool fTextureRedSupport : 1; |
| 305 bool fImagingSupport : 1; | 306 bool fImagingSupport : 1; |
| 306 bool fTwoFormatLimit : 1; | 307 bool fTwoFormatLimit : 1; |
| 307 bool fFragCoordsConventionSupport : 1; | 308 bool fFragCoordsConventionSupport : 1; |
| 308 bool fVertexArrayObjectSupport : 1; | 309 bool fVertexArrayObjectSupport : 1; |
| 309 bool fUseNonVBOVertexAndIndexDynamicData : 1; | 310 bool fUseNonVBOVertexAndIndexDynamicData : 1; |
| 310 bool fIsCoreProfile : 1; | 311 bool fIsCoreProfile : 1; |
| 312 |
| 313 typedef GrDrawTarget::Caps INHERITED; |
| 311 }; | 314 }; |
| 312 | 315 |
| 313 #endif | 316 #endif |
| OLD | NEW |