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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 2519603002: Add command buffer support for EXT_sRGB_write_control (Closed)
Patch Set: Review feedback Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 77000c5037eee2a85806b6bb6250b366d81f2f26..5d245123dcb7782d3c493b9482d90988aa0f4527 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -572,11 +572,13 @@ void FeatureInfo::InitializeFeatures() {
validators_.index_type.AddValue(GL_UNSIGNED_INT);
}
+ bool has_srgb_framebuffer_support = false;
if (gl_version_info_->IsAtLeastGL(3, 2) ||
(gl_version_info_->IsAtLeastGL(2, 0) &&
(extensions.Contains("GL_EXT_framebuffer_sRGB") ||
extensions.Contains("GL_ARB_framebuffer_sRGB")))) {
feature_flags_.desktop_srgb_support = true;
+ has_srgb_framebuffer_support = true;
}
// With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the
// <format> and <internalformat> parameter of TexImage2D. GLES3 adds support
@@ -599,6 +601,22 @@ void FeatureInfo::InitializeFeatures() {
GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT);
validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT);
validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
+ has_srgb_framebuffer_support = true;
+ }
+ if (context_type_ == CONTEXT_TYPE_OPENGLES3)
+ has_srgb_framebuffer_support = true;
Zhenyao Mo 2016/12/01 00:05:02 You should use gl_version_info_->is_es3 instead. c
ccameron 2016/12/01 00:39:02 Done.
+
+ if (has_srgb_framebuffer_support && !IsWebGLContext()) {
+ // GL_FRAMEBUFFER_SRGB_EXT is exposed by the GLES extension
+ // GL_EXT_sRGB_write_control (which is not part of the core, even in GLES3),
+ // and the desktop extension GL_ARB_framebuffer_sRGB (part of the core in
+ // 3.0).
+ if (feature_flags_.desktop_srgb_support ||
+ extensions.Contains("GL_EXT_sRGB_write_control")) {
+ feature_flags_.ext_srgb_write_control = true;
+ AddExtensionString("GL_EXT_sRGB_write_control");
+ validators_.capability.AddValue(GL_FRAMEBUFFER_SRGB_EXT);
+ }
}
// On desktop, GL_EXT_texture_sRGB is required regardless of GL version,
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698