diff options
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 8 | ||||
-rw-r--r-- | ui/gfx/gl/gl_implementation.cc | 5 | ||||
-rw-r--r-- | ui/gfx/gl/gl_implementation.h | 4 |
3 files changed, 12 insertions, 5 deletions
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 4936e7a..1e1a86c 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -232,8 +232,7 @@ void FeatureInfo::AddFeatures(const char* desired_features) { } if (ext.Desire("GL_OES_rgb8_rgba8")) { - if (ext.Have("GL_OES_rgb8_rgba8") || - gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL) { + if (ext.Have("GL_OES_rgb8_rgba8") || gfx::HasDesktopGLFeatures()) { AddExtensionString("GL_OES_rgb8_rgba8"); validators_.render_buffer_format.AddValue(GL_RGB8_OES); validators_.render_buffer_format.AddValue(GL_RGBA8_OES); @@ -316,14 +315,13 @@ void FeatureInfo::AddFeatures(const char* desired_features) { } if (ext.HaveAndDesire("GL_OES_depth24") || - (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL && - ext.Desire("GL_OES_depth24"))) { + (gfx::HasDesktopGLFeatures() && ext.Desire("GL_OES_depth24"))) { AddExtensionString("GL_OES_depth24"); validators_.render_buffer_format.AddValue(GL_DEPTH_COMPONENT24); } if (ext.HaveAndDesire("GL_OES_standard_derivatives") || - (gfx::GetGLImplementation() == gfx::kGLImplementationDesktopGL && + (gfx::HasDesktopGLFeatures() && ext.Desire("GL_OES_standard_derivatives"))) { AddExtensionString("GL_OES_standard_derivatives"); feature_flags_.oes_standard_derivatives = true; diff --git a/ui/gfx/gl/gl_implementation.cc b/ui/gfx/gl/gl_implementation.cc index 21788c0..ae4b2d6 100644 --- a/ui/gfx/gl/gl_implementation.cc +++ b/ui/gfx/gl/gl_implementation.cc @@ -106,6 +106,11 @@ GLImplementation GetGLImplementation() { return g_gl_implementation; } +bool HasDesktopGLFeatures() { + return kGLImplementationDesktopGL == g_gl_implementation || + kGLImplementationOSMesaGL == g_gl_implementation; +} + void AddGLNativeLibrary(base::NativeLibrary library) { DCHECK(library); diff --git a/ui/gfx/gl/gl_implementation.h b/ui/gfx/gl/gl_implementation.h index aab0bdf..9024ca1 100644 --- a/ui/gfx/gl/gl_implementation.h +++ b/ui/gfx/gl/gl_implementation.h @@ -42,6 +42,10 @@ void SetGLImplementation(GLImplementation implementation); // Get the current GL implementation. GL_EXPORT GLImplementation GetGLImplementation(); +// Does the underlying GL support all features from Desktop GL 2.0 that were +// removed from the ES 2.0 spec without requiring specific extension strings. +GL_EXPORT bool HasDesktopGLFeatures(); + // Get the GL implementation with a given name. GLImplementation GetNamedGLImplementation(const std::wstring& name); |