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

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

Issue 1781093002: Add CONTEXT_TYPE_OPENGLES2_PEPPER (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 a0ebe050a743ddc440dd5054683cbb36a29ec389..e3c3f927cf9ee8cced0b18e096966dd1b58b4081 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -856,10 +856,11 @@ void FeatureInfo::InitializeFeatures() {
// Check for multisample support
// crbug.com/527565 - On some GPUs, MSAA does not perform acceptably for
- // rasterization. We disable it on non-WebGL contexts. For WebGL contexts
- // we leave it up to the site to decide whether to enable MSAA.
+ // rasterization. For externally exposed (WebGL or Pepper) contexts we leave
+ // it up to the site to decide whether to enable MSAA.
bool disable_all_multisample =
- workarounds_.disable_msaa_on_non_webgl_contexts && !IsWebGLContext();
+ workarounds_.disable_msaa_on_internal_contexts && !IsWebGLContext() &&
+ !IsPepperContext();
if (!disable_all_multisample &&
!workarounds_.disable_chromium_framebuffer_multisample) {
@@ -1416,6 +1417,7 @@ bool FeatureInfo::IsWebGLContext() const {
return true;
case CONTEXT_TYPE_OPENGLES2:
case CONTEXT_TYPE_OPENGLES3:
+ case CONTEXT_TYPE_OPENGLES2_PEPPER:
return false;
}
@@ -1423,6 +1425,22 @@ bool FeatureInfo::IsWebGLContext() const {
return false;
}
+bool FeatureInfo::IsPepperContext() const {
+ // Switch statement to cause a compile-time error if we miss a case.
+ switch (context_type_) {
+ case CONTEXT_TYPE_WEBGL1:
+ case CONTEXT_TYPE_WEBGL2:
+ case CONTEXT_TYPE_OPENGLES2:
+ case CONTEXT_TYPE_OPENGLES3:
+ return false;
+ case CONTEXT_TYPE_OPENGLES2_PEPPER:
+ return true;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
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