Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1955603003: Bring back sRGB-write-control as a caps bit. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 ConfigInfo::kRenderableWithMSAA_Flag; 1450 ConfigInfo::kRenderableWithMSAA_Flag;
1451 } 1451 }
1452 } 1452 }
1453 } 1453 }
1454 if (texStorageSupported) { 1454 if (texStorageSupported) {
1455 fConfigTable[kBGRA_8888_GrPixelConfig].fFlags |= ConfigInfo::kCanUseTexS torage_Flag; 1455 fConfigTable[kBGRA_8888_GrPixelConfig].fFlags |= ConfigInfo::kCanUseTexS torage_Flag;
1456 } 1456 }
1457 fConfigTable[kBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA(); 1457 fConfigTable[kBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA();
1458 1458
1459 // We only enable srgb support if both textures and FBOs support srgb, 1459 // We only enable srgb support if both textures and FBOs support srgb,
1460 // *and* we can disable sRGB decode-on-read, to support "legacy" mode, 1460 // *and* we can disable sRGB decode-on-read, to support "legacy" mode.
1461 // *and* we can disable sRGB encode-on-write.
1462 if (kGL_GrGLStandard == standard) { 1461 if (kGL_GrGLStandard == standard) {
1463 if (ctxInfo.version() >= GR_GL_VER(3,0)) { 1462 if (ctxInfo.version() >= GR_GL_VER(3,0)) {
1464 fSRGBSupport = true; 1463 fSRGBSupport = true;
1465 } else if (ctxInfo.hasExtension("GL_EXT_texture_sRGB")) { 1464 } else if (ctxInfo.hasExtension("GL_EXT_texture_sRGB")) {
1466 if (ctxInfo.hasExtension("GL_ARB_framebuffer_sRGB") || 1465 if (ctxInfo.hasExtension("GL_ARB_framebuffer_sRGB") ||
1467 ctxInfo.hasExtension("GL_EXT_framebuffer_sRGB")) { 1466 ctxInfo.hasExtension("GL_EXT_framebuffer_sRGB")) {
1468 fSRGBSupport = true; 1467 fSRGBSupport = true;
1469 } 1468 }
1470 } 1469 }
1471 // All the above srgb extensions support toggling srgb writes 1470 // All the above srgb extensions support toggling srgb writes
1471 fSRGBWriteControl = true;
1472 } else { 1472 } else {
1473 // See https://bug.skia.org/4148 for PowerVR issue. 1473 // See https://bug.skia.org/4148 for PowerVR issue.
1474 fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() && 1474 fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() &&
1475 (ctxInfo.version() >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT _sRGB")); 1475 (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 1476 // ES through 3.1 requires EXT_srgb_write_control to support toggling
1477 // sRGB writing for destinations. 1477 // sRGB writing for destinations.
1478 fSRGBSupport = fSRGBSupport && ctxInfo.hasExtension("GL_EXT_sRGB_write_c ontrol"); 1478 fSRGBWriteControl = ctxInfo.hasExtension("GL_EXT_sRGB_write_control");
1479 } 1479 }
1480 if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) { 1480 if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) {
1481 // To support "legacy" L32 mode, we require the ability to turn off sRGB decode: 1481 // To support "legacy" L32 mode, we require the ability to turn off sRGB decode:
1482 fSRGBSupport = false; 1482 fSRGBSupport = false;
1483 } 1483 }
1484 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL _SRGB_ALPHA; 1484 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL _SRGB_ALPHA;
1485 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fSizedInternalFormat = GR_G L_SRGB8_ALPHA8; 1485 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fSizedInternalFormat = GR_G L_SRGB8_ALPHA8;
1486 // GL does not do srgb<->rgb conversions when transferring between cpu and g pu. Thus, the 1486 // GL does not do srgb<->rgb conversions when transferring between cpu and g pu. Thus, the
1487 // external format is GL_RGBA. See below for note about ES2.0 and glTex[Sub] Image. 1487 // external format is GL_RGBA. See below for note about ES2.0 and glTex[Sub] Image.
1488 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fExternalFormat[kOther_Exte rnalFormatUsage] = 1488 fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fExternalFormat[kOther_Exte rnalFormatUsage] =
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 for (int j = 0; j < kExternalFormatUsageCnt; ++j) { 1903 for (int j = 0; j < kExternalFormatUsageCnt; ++j) {
1904 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] != 1904 SkASSERT(defaultEntry.fFormats.fExternalFormat[j] !=
1905 fConfigTable[i].fFormats.fExternalFormat[j]); 1905 fConfigTable[i].fFormats.fExternalFormat[j]);
1906 } 1906 }
1907 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType); 1907 SkASSERT(defaultEntry.fFormats.fExternalType != fConfigTable[i].fFormats .fExternalType);
1908 } 1908 }
1909 #endif 1909 #endif
1910 } 1910 }
1911 1911
1912 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {} 1912 void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {}
OLDNEW
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698