| 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 <functional> | 
|  | 13 | 
| 12 #include "glsl/GrGLSL.h" | 14 #include "glsl/GrGLSL.h" | 
| 13 #include "GrCaps.h" | 15 #include "GrCaps.h" | 
| 14 #include "GrGLStencilAttachment.h" | 16 #include "GrGLStencilAttachment.h" | 
| 15 #include "GrSwizzle.h" | 17 #include "GrSwizzle.h" | 
| 16 #include "SkChecksum.h" | 18 #include "SkChecksum.h" | 
| 17 #include "SkTHash.h" | 19 #include "SkTHash.h" | 
| 18 #include "SkTArray.h" | 20 #include "SkTArray.h" | 
| 19 | 21 | 
| 20 class GrGLContextInfo; | 22 class GrGLContextInfo; | 
| 21 class GrGLSLCaps; | 23 class GrGLSLCaps; | 
|  | 24 class GrGLRenderTarget; | 
| 22 | 25 | 
| 23 /** | 26 /** | 
| 24  * Stores some capabilities of a GL context. Most are determined by the GL | 27  * Stores some capabilities of a GL context. Most are determined by the GL | 
| 25  * version and the extensions string. It also tracks formats that have passed | 28  * version and the extensions string. It also tracks formats that have passed | 
| 26  * the FBO completeness test. | 29  * the FBO completeness test. | 
| 27  */ | 30  */ | 
| 28 class GrGLCaps : public GrCaps { | 31 class GrGLCaps : public GrCaps { | 
| 29 public: | 32 public: | 
| 30     typedef GrGLStencilAttachment::Format StencilFormat; | 33     typedef GrGLStencilAttachment::Format StencilFormat; | 
| 31 | 34 | 
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 276 | 279 | 
| 277     /// Is there support for ES2 compatability? | 280     /// Is there support for ES2 compatability? | 
| 278     bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; } | 281     bool ES2CompatibilitySupport() const { return fES2CompatibilitySupport; } | 
| 279 | 282 | 
| 280     /// Can we call glDisable(GL_MULTISAMPLE)? | 283     /// Can we call glDisable(GL_MULTISAMPLE)? | 
| 281     bool multisampleDisableSupport() const { return fMultisampleDisableSupport; 
     } | 284     bool multisampleDisableSupport() const { return fMultisampleDisableSupport; 
     } | 
| 282 | 285 | 
| 283     /// Use indices or vertices in CPU arrays rather than VBOs for dynamic conte
     nt. | 286     /// Use indices or vertices in CPU arrays rather than VBOs for dynamic conte
     nt. | 
| 284     bool useNonVBOVertexAndIndexDynamicData() const { return fUseNonVBOVertexAnd
     IndexDynamicData; } | 287     bool useNonVBOVertexAndIndexDynamicData() const { return fUseNonVBOVertexAnd
     IndexDynamicData; } | 
| 285 | 288 | 
| 286     /// Does ReadPixels support the provided format/type combo? | 289     /// Does ReadPixels support reading readConfig pixels from a FBO that is ren
     derTargetConfig? | 
| 287     bool readPixelsSupported(const GrGLInterface* intf, | 290     bool readPixelsSupported(GrPixelConfig renderTargetConfig, | 
| 288                              GrPixelConfig readConfig, | 291                              GrPixelConfig readConfig, | 
| 289                              GrPixelConfig currFBOConfig) const; | 292                              std::function<void (GrGLenum, GrGLint*)> getInteger
     v, | 
|  | 293                              std::function<bool ()> bindRenderTarget) const; | 
| 290 | 294 | 
| 291     bool isCoreProfile() const { return fIsCoreProfile; } | 295     bool isCoreProfile() const { return fIsCoreProfile; } | 
| 292 | 296 | 
| 293     bool bindFragDataLocationSupport() const { return fBindFragDataLocationSuppo
     rt; } | 297     bool bindFragDataLocationSupport() const { return fBindFragDataLocationSuppo
     rt; } | 
| 294 | 298 | 
| 295     bool bindUniformLocationSupport() const { return fBindUniformLocationSupport
     ; } | 299     bool bindUniformLocationSupport() const { return fBindUniformLocationSupport
     ; } | 
| 296 | 300 | 
| 297     /// Are textures with GL_TEXTURE_EXTERNAL_OES type supported. | 301     /// Are textures with GL_TEXTURE_EXTERNAL_OES type supported. | 
| 298     bool externalTextureSupport() const { return fExternalTextureSupport; } | 302     bool externalTextureSupport() const { return fExternalTextureSupport; } | 
| 299 | 303 | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 341     void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*); | 345     void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*); | 
| 342     void initBlendEqationSupport(const GrGLContextInfo&); | 346     void initBlendEqationSupport(const GrGLContextInfo&); | 
| 343     void initStencilFormats(const GrGLContextInfo&); | 347     void initStencilFormats(const GrGLContextInfo&); | 
| 344     // This must be called after initFSAASupport(). | 348     // This must be called after initFSAASupport(). | 
| 345     void initConfigTable(const GrGLContextInfo&, const GrGLInterface* gli, GrGLS
     LCaps* glslCaps); | 349     void initConfigTable(const GrGLContextInfo&, const GrGLInterface* gli, GrGLS
     LCaps* glslCaps); | 
| 346 | 350 | 
| 347     void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, | 351     void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, | 
| 348                                   const GrGLInterface* intf, | 352                                   const GrGLInterface* intf, | 
| 349                                   GrGLSLCaps* glslCaps); | 353                                   GrGLSLCaps* glslCaps); | 
| 350 | 354 | 
|  | 355     GrGLStandard fStandard; | 
|  | 356 | 
| 351     SkTArray<StencilFormat, true> fStencilFormats; | 357     SkTArray<StencilFormat, true> fStencilFormats; | 
| 352 | 358 | 
| 353     int fMaxFragmentUniformVectors; | 359     int fMaxFragmentUniformVectors; | 
| 354     int fMaxVertexAttributes; | 360     int fMaxVertexAttributes; | 
| 355     int fMaxFragmentTextureUnits; | 361     int fMaxFragmentTextureUnits; | 
| 356 | 362 | 
| 357     MSFBOType           fMSFBOType; | 363     MSFBOType           fMSFBOType; | 
| 358     InvalidateFBType    fInvalidateFBType; | 364     InvalidateFBType    fInvalidateFBType; | 
| 359     MapBufferType       fMapBufferType; | 365     MapBufferType       fMapBufferType; | 
| 360     TransferBufferType  fTransferBufferType; | 366     TransferBufferType  fTransferBufferType; | 
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 450 | 456 | 
| 451         GrSwizzle fSwizzle; | 457         GrSwizzle fSwizzle; | 
| 452     }; | 458     }; | 
| 453 | 459 | 
| 454     ConfigInfo fConfigTable[kGrPixelConfigCnt]; | 460     ConfigInfo fConfigTable[kGrPixelConfigCnt]; | 
| 455 | 461 | 
| 456     typedef GrCaps INHERITED; | 462     typedef GrCaps INHERITED; | 
| 457 }; | 463 }; | 
| 458 | 464 | 
| 459 #endif | 465 #endif | 
| OLD | NEW | 
|---|