| 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 | |
| 177 /// Is there support for GL_UNPACK_ROW_LENGTH | 174 /// Is there support for GL_UNPACK_ROW_LENGTH |
| 178 bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; } | 175 bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; } |
| 179 | 176 |
| 180 /// Is there support for GL_UNPACK_FLIP_Y | 177 /// Is there support for GL_UNPACK_FLIP_Y |
| 181 bool unpackFlipYSupport() const { return fUnpackFlipYSupport; } | 178 bool unpackFlipYSupport() const { return fUnpackFlipYSupport; } |
| 182 | 179 |
| 183 /// Is there support for GL_PACK_ROW_LENGTH | 180 /// Is there support for GL_PACK_ROW_LENGTH |
| 184 bool packRowLengthSupport() const { return fPackRowLengthSupport; } | 181 bool packRowLengthSupport() const { return fPackRowLengthSupport; } |
| 185 | 182 |
| 186 /// Is there support for GL_PACK_REVERSE_ROW_ORDER | 183 /// Is there support for GL_PACK_REVERSE_ROW_ORDER |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 bool rgba8888PixelsOpsAreSlow() const { return fRGBA8888PixelsOpsAreSlow; } | 263 bool rgba8888PixelsOpsAreSlow() const { return fRGBA8888PixelsOpsAreSlow; } |
| 267 bool partialFBOReadIsSlow() const { return fPartialFBOReadIsSlow; } | 264 bool partialFBOReadIsSlow() const { return fPartialFBOReadIsSlow; } |
| 268 | 265 |
| 269 const GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fS
haderCaps.get()); } | 266 const GrGLSLCaps* glslCaps() const { return reinterpret_cast<GrGLSLCaps*>(fS
haderCaps.get()); } |
| 270 | 267 |
| 271 private: | 268 private: |
| 272 void init(const GrContextOptions&, const GrGLContextInfo&, const GrGLInterfa
ce*); | 269 void init(const GrContextOptions&, const GrGLContextInfo&, const GrGLInterfa
ce*); |
| 273 void initGLSL(const GrGLContextInfo&); | 270 void initGLSL(const GrGLContextInfo&); |
| 274 bool hasPathRenderingSupport(const GrGLContextInfo&, const GrGLInterface*); | 271 bool hasPathRenderingSupport(const GrGLContextInfo&, const GrGLInterface*); |
| 275 | 272 |
| 273 void onApplyOptionsOverrides(const GrContextOptions& options) override; |
| 274 |
| 276 /** | 275 /** |
| 277 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly | 276 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly |
| 278 * performing glCheckFrameBufferStatus for the same config. | 277 * performing glCheckFrameBufferStatus for the same config. |
| 279 */ | 278 */ |
| 280 struct VerifiedColorConfigs { | 279 struct VerifiedColorConfigs { |
| 281 VerifiedColorConfigs() { | 280 VerifiedColorConfigs() { |
| 282 this->reset(); | 281 this->reset(); |
| 283 } | 282 } |
| 284 | 283 |
| 285 void reset() { | 284 void reset() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 316 // This must be called after initFSAASupport(). | 315 // This must be called after initFSAASupport(). |
| 317 void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport); | 316 void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport); |
| 318 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*,
bool srgbSupport); | 317 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*,
bool srgbSupport); |
| 319 | 318 |
| 320 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLe
num type) const; | 319 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLe
num type) const; |
| 321 | 320 |
| 322 void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, | 321 void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, |
| 323 const GrGLInterface* intf, | 322 const GrGLInterface* intf, |
| 324 GrGLSLCaps* glslCaps); | 323 GrGLSLCaps* glslCaps); |
| 325 | 324 |
| 325 void initConfigSwizzleTable(const GrGLContextInfo& ctxInfo, GrGLSLCaps* glsl
Caps); |
| 326 |
| 326 // tracks configs that have been verified to pass the FBO completeness when | 327 // tracks configs that have been verified to pass the FBO completeness when |
| 327 // used as a color attachment | 328 // used as a color attachment |
| 328 VerifiedColorConfigs fVerifiedColorConfigs; | 329 VerifiedColorConfigs fVerifiedColorConfigs; |
| 329 | 330 |
| 330 SkTArray<StencilFormat, true> fStencilFormats; | 331 SkTArray<StencilFormat, true> fStencilFormats; |
| 331 | 332 |
| 332 int fMaxFragmentUniformVectors; | 333 int fMaxFragmentUniformVectors; |
| 333 int fMaxVertexAttributes; | 334 int fMaxVertexAttributes; |
| 334 int fMaxFragmentTextureUnits; | 335 int fMaxFragmentTextureUnits; |
| 335 | 336 |
| 336 MSFBOType fMSFBOType; | 337 MSFBOType fMSFBOType; |
| 337 InvalidateFBType fInvalidateFBType; | 338 InvalidateFBType fInvalidateFBType; |
| 338 MapBufferType fMapBufferType; | 339 MapBufferType fMapBufferType; |
| 339 LATCAlias fLATCAlias; | 340 LATCAlias fLATCAlias; |
| 340 | 341 |
| 341 bool fRGBA8RenderbufferSupport : 1; | 342 bool fRGBA8RenderbufferSupport : 1; |
| 342 bool fBGRAIsInternalFormat : 1; | 343 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 |