| 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 #include "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
| 10 | 10 |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 // All the above srgb extensions support toggling srgb writes | 1470 // All the above srgb extensions support toggling srgb writes |
| 1471 if (fSRGBSupport) { | 1471 if (fSRGBSupport) { |
| 1472 fSRGBWriteControl = true; | 1472 fSRGBWriteControl = true; |
| 1473 } | 1473 } |
| 1474 } else { | 1474 } else { |
| 1475 // See https://bug.skia.org/4148 for PowerVR issue. | 1475 // See https://bug.skia.org/4148 for PowerVR issue. |
| 1476 fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() && | 1476 fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() && |
| 1477 (ctxInfo.version() >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT
_sRGB")); | 1477 (ctxInfo.version() >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT
_sRGB")); |
| 1478 // ES through 3.1 requires EXT_srgb_write_control to support toggling | 1478 // ES through 3.1 requires EXT_srgb_write_control to support toggling |
| 1479 // sRGB writing for destinations. | 1479 // sRGB writing for destinations. |
| 1480 fSRGBWriteControl = ctxInfo.hasExtension("GL_EXT_sRGB_write_control"); | 1480 // See https://bug.skia.org/5329 for Adreno4xx issue. |
| 1481 fSRGBWriteControl = kAdreno4xx_GrGLRenderer != ctxInfo.renderer() && |
| 1482 ctxInfo.hasExtension("GL_EXT_sRGB_write_control"); |
| 1481 } | 1483 } |
| 1482 if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) { | 1484 if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) { |
| 1483 // To support "legacy" L32 mode, we require the ability to turn off sRGB
decode: | 1485 // To support "legacy" L32 mode, we require the ability to turn off sRGB
decode: |
| 1484 fSRGBSupport = false; | 1486 fSRGBSupport = false; |
| 1485 } | 1487 } |
| 1486 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL
_SRGB_ALPHA; | 1488 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL
_SRGB_ALPHA; |
| 1487 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fSizedInternalFormat = GR_G
L_SRGB8_ALPHA8; | 1489 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fSizedInternalFormat = GR_G
L_SRGB8_ALPHA8; |
| 1488 // GL does not do srgb<->rgb conversions when transferring between cpu and g
pu. Thus, the | 1490 // GL does not do srgb<->rgb conversions when transferring between cpu and g
pu. Thus, the |
| 1489 // external format is GL_RGBA. See below for note about ES2.0 and glTex[Sub]
Image. | 1491 // external format is GL_RGBA. See below for note about ES2.0 and glTex[Sub]
Image. |
| 1490 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fExternalFormat[kOther_Exte
rnalFormatUsage] = | 1492 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fExternalFormat[kOther_Exte
rnalFormatUsage] = |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1910 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
| 1909 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1911 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
| 1910 fConfigTable[i].fFormats.fExternalFormat[j]); | 1912 fConfigTable[i].fFormats.fExternalFormat[j]); |
| 1911 } | 1913 } |
| 1912 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1914 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
| 1913 } | 1915 } |
| 1914 #endif | 1916 #endif |
| 1915 } | 1917 } |
| 1916 | 1918 |
| 1917 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1919 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
| OLD | NEW |