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 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 if (kGL_GrGLStandard == standard) { | 1461 if (kGL_GrGLStandard == standard) { |
1462 if (ctxInfo.version() >= GR_GL_VER(3,0)) { | 1462 if (ctxInfo.version() >= GR_GL_VER(3,0)) { |
1463 fSRGBSupport = true; | 1463 fSRGBSupport = true; |
1464 } else if (ctxInfo.hasExtension("GL_EXT_texture_sRGB")) { | 1464 } else if (ctxInfo.hasExtension("GL_EXT_texture_sRGB")) { |
1465 if (ctxInfo.hasExtension("GL_ARB_framebuffer_sRGB") || | 1465 if (ctxInfo.hasExtension("GL_ARB_framebuffer_sRGB") || |
1466 ctxInfo.hasExtension("GL_EXT_framebuffer_sRGB")) { | 1466 ctxInfo.hasExtension("GL_EXT_framebuffer_sRGB")) { |
1467 fSRGBSupport = true; | 1467 fSRGBSupport = true; |
1468 } | 1468 } |
1469 } | 1469 } |
1470 // All the above srgb extensions support toggling srgb writes | 1470 // All the above srgb extensions support toggling srgb writes |
1471 fSRGBWriteControl = true; | 1471 if (fSRGBSupport) { |
| 1472 fSRGBWriteControl = true; |
| 1473 } |
1472 } else { | 1474 } else { |
1473 // See https://bug.skia.org/4148 for PowerVR issue. | 1475 // See https://bug.skia.org/4148 for PowerVR issue. |
1474 fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() && | 1476 fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() && |
1475 (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")); |
1476 // 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 |
1477 // sRGB writing for destinations. | 1479 // sRGB writing for destinations. |
1478 fSRGBWriteControl = ctxInfo.hasExtension("GL_EXT_sRGB_write_control"); | 1480 fSRGBWriteControl = ctxInfo.hasExtension("GL_EXT_sRGB_write_control"); |
1479 } | 1481 } |
1480 if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) { | 1482 if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) { |
1481 // To support "legacy" L32 mode, we require the ability to turn off sRGB
decode: | 1483 // To support "legacy" L32 mode, we require the ability to turn off sRGB
decode: |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { | 1908 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { |
1907 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != | 1909 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != |
1908 fConfigTable[i].fFormats.fExternalFormat[j]); | 1910 fConfigTable[i].fFormats.fExternalFormat[j]); |
1909 } | 1911 } |
1910 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); | 1912 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats
.fExternalType); |
1911 } | 1913 } |
1912 #endif | 1914 #endif |
1913 } | 1915 } |
1914 | 1916 |
1915 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} | 1917 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} |
OLD | NEW |