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

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

Issue 987123003: Add a mechanism for command buffer to conditionally allow ES3 enums. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
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 897afd3477adb3a314093c8849077a6d1b1fc9b3..8bcabdad6143b41c90d79a55cf1f7fdafc0c74df 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -1052,6 +1052,27 @@ void FeatureInfo::InitializeFeatures() {
#endif
}
+bool FeatureInfo::IsES3Capable() const {
+ if (gl_version_info_->IsAtLeastGLES(3, 0))
+ return true;
+ // TODO(zmo): For Desktop GL, with anything lower than 4.2, we need to check
+ // the existence of a few extensions to have full WebGL 2 capabilities.
+ if (gl_version_info_->IsAtLeastGL(4, 2))
+ return true;
+#if defined(OS_MACOSX)
+ // TODO(zmo): For experimentation purpose on MacOSX with core profile,
+ // allow 3.2 or plus for now.
+ if (gl_version_info_->IsAtLeastGL(3, 2))
+ return true;
+#endif
+ return false;
+}
+
+void FeatureInfo::EnableES3() {
no sievers 2015/03/09 22:48:20 nit: Maybe EnableES3Validators()? Or even EnableUn
Zhenyao Mo 2015/03/09 23:27:02 Done.
+ DCHECK(IsES3Capable());
+ validators_.AddES3Values();
+}
+
void FeatureInfo::AddExtensionString(const char* s) {
std::string str(s);
size_t pos = extensions_.find(str);

Powered by Google App Engine
This is Rietveld 408576698