| 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 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 /// ES requires an extension to support RGBA8 in RenderBufferStorage | 164 /// ES requires an extension to support RGBA8 in RenderBufferStorage |
| 165 bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; } | 165 bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; } |
| 166 | 166 |
| 167 /** | 167 /** |
| 168 * Depending on the ES extensions present the BGRA external format may | 168 * Depending on the ES extensions present the BGRA external format may |
| 169 * correspond either a BGRA or RGBA internalFormat. On desktop GL it is | 169 * correspond either a BGRA or RGBA internalFormat. On desktop GL it is |
| 170 * RGBA. | 170 * RGBA. |
| 171 */ | 171 */ |
| 172 bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; } | 172 bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; } |
| 173 | 173 |
| 174 /// GL_ARB_texture_swizzle support |
| 175 bool textureSwizzleSupport() const { return fTextureSwizzleSupport; } |
| 176 |
| 174 /// Is there support for GL_UNPACK_ROW_LENGTH | 177 /// Is there support for GL_UNPACK_ROW_LENGTH |
| 175 bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; } | 178 bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; } |
| 176 | 179 |
| 177 /// Is there support for GL_UNPACK_FLIP_Y | 180 /// Is there support for GL_UNPACK_FLIP_Y |
| 178 bool unpackFlipYSupport() const { return fUnpackFlipYSupport; } | 181 bool unpackFlipYSupport() const { return fUnpackFlipYSupport; } |
| 179 | 182 |
| 180 /// Is there support for GL_PACK_ROW_LENGTH | 183 /// Is there support for GL_PACK_ROW_LENGTH |
| 181 bool packRowLengthSupport() const { return fPackRowLengthSupport; } | 184 bool packRowLengthSupport() const { return fPackRowLengthSupport; } |
| 182 | 185 |
| 183 /// Is there support for GL_PACK_REVERSE_ROW_ORDER | 186 /// Is there support for GL_PACK_REVERSE_ROW_ORDER |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 bool rgba8888PixelsOpsAreSlow() const { return fRGBA8888PixelsOpsAreSlow; } | 266 bool rgba8888PixelsOpsAreSlow() const { return fRGBA8888PixelsOpsAreSlow; } |
| 264 bool partialFBOReadIsSlow() const { return fPartialFBOReadIsSlow; } | 267 bool partialFBOReadIsSlow() const { return fPartialFBOReadIsSlow; } |
| 265 | 268 |
| 266 const GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fS
haderCaps.get()); } | 269 const GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fS
haderCaps.get()); } |
| 267 | 270 |
| 268 private: | 271 private: |
| 269 void init(const GrContextOptions&, const GrGLContextInfo&, const GrGLInterfa
ce*); | 272 void init(const GrContextOptions&, const GrGLContextInfo&, const GrGLInterfa
ce*); |
| 270 void initGLSL(const GrGLContextInfo&); | 273 void initGLSL(const GrGLContextInfo&); |
| 271 bool hasPathRenderingSupport(const GrGLContextInfo&, const GrGLInterface*); | 274 bool hasPathRenderingSupport(const GrGLContextInfo&, const GrGLInterface*); |
| 272 | 275 |
| 273 void onApplyOptionsOverrides(const GrContextOptions& options) override; | |
| 274 | |
| 275 /** | 276 /** |
| 276 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly | 277 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly |
| 277 * performing glCheckFrameBufferStatus for the same config. | 278 * performing glCheckFrameBufferStatus for the same config. |
| 278 */ | 279 */ |
| 279 struct VerifiedColorConfigs { | 280 struct VerifiedColorConfigs { |
| 280 VerifiedColorConfigs() { | 281 VerifiedColorConfigs() { |
| 281 this->reset(); | 282 this->reset(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 void reset() { | 285 void reset() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 315 // This must be called after initFSAASupport(). | 316 // This must be called after initFSAASupport(). |
| 316 void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport); | 317 void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport); |
| 317 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*,
bool srgbSupport); | 318 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*,
bool srgbSupport); |
| 318 | 319 |
| 319 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLe
num type) const; | 320 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLe
num type) const; |
| 320 | 321 |
| 321 void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, | 322 void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, |
| 322 const GrGLInterface* intf, | 323 const GrGLInterface* intf, |
| 323 GrGLSLCaps* glslCaps); | 324 GrGLSLCaps* glslCaps); |
| 324 | 325 |
| 325 void initConfigSwizzleTable(const GrGLContextInfo& ctxInfo, GrGLSLCaps* glsl
Caps); | |
| 326 | |
| 327 // tracks configs that have been verified to pass the FBO completeness when | 326 // tracks configs that have been verified to pass the FBO completeness when |
| 328 // used as a color attachment | 327 // used as a color attachment |
| 329 VerifiedColorConfigs fVerifiedColorConfigs; | 328 VerifiedColorConfigs fVerifiedColorConfigs; |
| 330 | 329 |
| 331 SkTArray<StencilFormat, true> fStencilFormats; | 330 SkTArray<StencilFormat, true> fStencilFormats; |
| 332 | 331 |
| 333 int fMaxFragmentUniformVectors; | 332 int fMaxFragmentUniformVectors; |
| 334 int fMaxVertexAttributes; | 333 int fMaxVertexAttributes; |
| 335 int fMaxFragmentTextureUnits; | 334 int fMaxFragmentTextureUnits; |
| 336 | 335 |
| 337 MSFBOType fMSFBOType; | 336 MSFBOType fMSFBOType; |
| 338 InvalidateFBType fInvalidateFBType; | 337 InvalidateFBType fInvalidateFBType; |
| 339 MapBufferType fMapBufferType; | 338 MapBufferType fMapBufferType; |
| 340 LATCAlias fLATCAlias; | 339 LATCAlias fLATCAlias; |
| 341 | 340 |
| 342 bool fRGBA8RenderbufferSupport : 1; | 341 bool fRGBA8RenderbufferSupport : 1; |
| 343 bool fBGRAIsInternalFormat : 1; | 342 bool fBGRAIsInternalFormat : 1; |
| 343 bool fTextureSwizzleSupport : 1; |
| 344 bool fUnpackRowLengthSupport : 1; | 344 bool fUnpackRowLengthSupport : 1; |
| 345 bool fUnpackFlipYSupport : 1; | 345 bool fUnpackFlipYSupport : 1; |
| 346 bool fPackRowLengthSupport : 1; | 346 bool fPackRowLengthSupport : 1; |
| 347 bool fPackFlipYSupport : 1; | 347 bool fPackFlipYSupport : 1; |
| 348 bool fTextureUsageSupport : 1; | 348 bool fTextureUsageSupport : 1; |
| 349 bool fTexStorageSupport : 1; | 349 bool fTexStorageSupport : 1; |
| 350 bool fTextureRedSupport : 1; | 350 bool fTextureRedSupport : 1; |
| 351 bool fImagingSupport : 1; | 351 bool fImagingSupport : 1; |
| 352 bool fTwoFormatLimit : 1; | 352 bool fTwoFormatLimit : 1; |
| 353 bool fFragCoordsConventionSupport : 1; | 353 bool fFragCoordsConventionSupport : 1; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 375 && fType == rhs.fType | 375 && fType == rhs.fType |
| 376 && fFboFormat == rhs.fFboFormat; | 376 && fFboFormat == rhs.fFboFormat; |
| 377 } | 377 } |
| 378 }; | 378 }; |
| 379 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCach
e; | 379 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCach
e; |
| 380 | 380 |
| 381 typedef GrCaps INHERITED; | 381 typedef GrCaps INHERITED; |
| 382 }; | 382 }; |
| 383 | 383 |
| 384 #endif | 384 #endif |
| OLD | NEW |