Skip to content

Commit

Permalink
Move WebGL blacklist decision making to GPU process.
Browse files Browse the repository at this point in the history
Still, if we pass in a commandline switch to disable WebGL1/2, they are still
pass to renderer process as WebPreferences.

BUG=744658
TEST=bots
R=kbr@chromium.org,piman@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I15fc34bc72d1c86d31d392bd34230d366564c318
Reviewed-on: https://chromium-review.googlesource.com/659100
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502466}
  • Loading branch information
zhenyao authored and Commit Bot committed Sep 16, 2017
1 parent d15c799 commit a3fda99
Show file tree
Hide file tree
Showing 86 changed files with 198 additions and 232 deletions.
7 changes: 4 additions & 3 deletions android_webview/browser/aw_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,10 @@ void AwSettings::PopulateWebPreferencesLocked(JNIEnv* env,
// Using 100M instead of max int to avoid overflows.
web_prefs->minimum_accelerated_2d_canvas_size = 100 * 1000 * 1000;
}
web_prefs->experimental_webgl_enabled =
web_prefs->experimental_webgl_enabled &&
enable_supported_hardware_accelerated_features;
web_prefs->webgl1_enabled = web_prefs->webgl1_enabled &&
enable_supported_hardware_accelerated_features;
web_prefs->webgl2_enabled = web_prefs->webgl2_enabled &&
enable_supported_hardware_accelerated_features;

// If strict mixed content checking is enabled then running should not be
// allowed.
Expand Down
9 changes: 0 additions & 9 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,6 @@ const FeatureEntry::Choice kEnableGpuRasterizationChoices[] = {
switches::kForceGpuRasterization, ""},
};

const FeatureEntry::Choice kEnableWebGL2Choices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
{flags_ui::kGenericExperimentChoiceEnabled, switches::kEnableES3APIs, ""},
{flags_ui::kGenericExperimentChoiceDisabled, switches::kDisableES3APIs, ""},
};

#if defined(OS_CHROMEOS)
const FeatureEntry::Choice kMemoryPressureThresholdChoices[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
Expand Down Expand Up @@ -2445,9 +2439,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAutomaticTabDiscardingDescription, kOsWin | kOsMac,
FEATURE_VALUE_TYPE(features::kAutomaticTabDiscarding)},
#endif // OS_WIN || OS_MACOSX
{"enable-es3-apis", flag_descriptions::kWebgl2Name,
flag_descriptions::kWebgl2Description, kOsAll,
MULTI_VALUE_TYPE(kEnableWebGL2Choices)},
{"enable-webfonts-intervention-v2",
flag_descriptions::kEnableWebfontsInterventionName,
flag_descriptions::kEnableWebfontsInterventionDescription, kOsAll,
Expand Down
6 changes: 4 additions & 2 deletions chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2448,8 +2448,10 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
web_prefs->loads_images_automatically =
prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically);

if (prefs->GetBoolean(prefs::kDisable3DAPIs))
web_prefs->experimental_webgl_enabled = false;
if (prefs->GetBoolean(prefs::kDisable3DAPIs)) {
web_prefs->webgl1_enabled = false;
web_prefs->webgl2_enabled = false;
}

web_prefs->allow_running_insecure_content =
prefs->GetBoolean(prefs::kWebKitAllowRunningInsecureContent);
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1430,9 +1430,6 @@ const char kWalletServiceUseSandboxName[] =
const char kWalletServiceUseSandboxDescription[] =
"For developers: use the sandbox service for Google Payments API calls.";

const char kWebgl2Name[] = "WebGL 2.0";
const char kWebgl2Description[] = "Allow web applications to access WebGL 2.0.";

const char kWebglDraftExtensionsName[] = "WebGL Draft Extensions";
const char kWebglDraftExtensionsDescription[] =
"Enabling this option allows web applications to access the WebGL "
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,6 @@ extern const char kVideoRotateToFullscreenDescription[];
extern const char kWalletServiceUseSandboxName[];
extern const char kWalletServiceUseSandboxDescription[];

extern const char kWebgl2Name[];
extern const char kWebgl2Description[];

extern const char kWebglDraftExtensionsName[];
extern const char kWebglDraftExtensionsDescription[];

Expand Down
5 changes: 3 additions & 2 deletions content/browser/gpu/compositor_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
" and hardware acceleration will be unavailable.",
true},
{kWebGLFeatureName, !manager->IsWebGLEnabled(),
command_line.HasSwitch(switches::kDisableExperimentalWebGL),
command_line.HasSwitch(switches::kDisableWebGL),
"WebGL has been disabled via blacklist or the command line.", false},
{"flash_3d", manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D),
command_line.HasSwitch(switches::kDisableFlash3d),
Expand Down Expand Up @@ -142,7 +142,8 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
" or command line.",
true},
{kWebGL2FeatureName, !manager->IsWebGL2Enabled(),
command_line.HasSwitch(switches::kDisableES3APIs),
command_line.HasSwitch(switches::kDisableWebGL) ||
command_line.HasSwitch(switches::kDisableWebGL2),
"WebGL2 has been disabled via blacklist or the command line.", false},
{kCheckerImagingFeatureName, false, !IsCheckerImagingEnabled(),
"Checker-imaging has been disabled via finch trial or the command line.",
Expand Down
15 changes: 6 additions & 9 deletions content/browser/gpu/gpu_data_manager_impl_private.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ int GetGpuBlacklistHistogramValueWin(gpu::GpuFeatureStatus status) {
case gpu::kGpuFeatureStatusDisabled:
entry_index += 2;
break;
case gpu::kGpuFeatureStatusSoftware:
entry_index += 3;
break;
case gpu::kGpuFeatureStatusUndefined:
case gpu::kGpuFeatureStatusMax:
NOTREACHED();
Expand Down Expand Up @@ -184,9 +187,9 @@ void UpdateStats(const gpu::GPUInfo& gpu_info,
command_line.HasSwitch(switches::kDisableAccelerated2dCanvas),
command_line.HasSwitch(switches::kDisableGpu),
command_line.HasSwitch(switches::kDisableGpuRasterization),
command_line.HasSwitch(switches::kDisableExperimentalWebGL),
(!command_line.HasSwitch(switches::kEnableES3APIs) ||
command_line.HasSwitch(switches::kDisableES3APIs))};
command_line.HasSwitch(switches::kDisableWebGL),
(command_line.HasSwitch(switches::kDisableWebGL) ||
command_line.HasSwitch(switches::kDisableWebGL2))};
#if defined(OS_WIN)
const std::string kGpuBlacklistFeatureHistogramNamesWin[] = {
"GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas",
Expand Down Expand Up @@ -813,7 +816,6 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs(
DCHECK(prefs);

if (!IsWebGLEnabled()) {
prefs->experimental_webgl_enabled = false;
prefs->pepper_3d_enabled = false;
}
if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D))
Expand Down Expand Up @@ -855,11 +857,6 @@ void GpuDataManagerImplPrivate::UpdateGpuPreferences(
if (ShouldDisableAcceleratedVideoDecode(command_line))
gpu_preferences->disable_accelerated_video_decode = true;

gpu_preferences->enable_es3_apis =
(command_line->HasSwitch(switches::kEnableES3APIs) ||
IsWebGL2Enabled()) &&
!command_line->HasSwitch(switches::kDisableES3APIs);

gpu_preferences->gpu_program_cache_size =
gpu::ShaderDiskCache::CacheSizeBytes();
}
Expand Down
1 change: 0 additions & 1 deletion content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDefaultTileWidth,
switches::kDefaultTileHeight,
switches::kDisable2dCanvasImageChromium,
switches::kDisable3DAPIs,
switches::kDisableAcceleratedJpegDecoding,
switches::kDisableAcceleratedVideoDecode,
switches::kDisableBackgroundTimerThrottling,
Expand Down
9 changes: 5 additions & 4 deletions content/browser/renderer_host/render_view_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,11 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
prefs.databases_enabled =
!command_line.HasSwitch(switches::kDisableDatabases);

prefs.experimental_webgl_enabled =
GpuProcessHost::gpu_enabled() &&
!command_line.HasSwitch(switches::kDisable3DAPIs) &&
!command_line.HasSwitch(switches::kDisableExperimentalWebGL);
prefs.webgl1_enabled = !command_line.HasSwitch(switches::kDisable3DAPIs) &&
!command_line.HasSwitch(switches::kDisableWebGL);
prefs.webgl2_enabled = !command_line.HasSwitch(switches::kDisable3DAPIs) &&
!command_line.HasSwitch(switches::kDisableWebGL) &&
!command_line.HasSwitch(switches::kDisableWebGL2);

prefs.pepper_3d_enabled =
!command_line.HasSwitch(switches::kDisablePepper3d);
Expand Down
3 changes: 2 additions & 1 deletion content/public/common/common_param_traits_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(hyperlink_auditing_enabled)
IPC_STRUCT_TRAITS_MEMBER(allow_universal_access_from_file_urls)
IPC_STRUCT_TRAITS_MEMBER(allow_file_access_from_file_urls)
IPC_STRUCT_TRAITS_MEMBER(experimental_webgl_enabled)
IPC_STRUCT_TRAITS_MEMBER(webgl1_enabled)
IPC_STRUCT_TRAITS_MEMBER(webgl2_enabled)
IPC_STRUCT_TRAITS_MEMBER(pepper_3d_enabled)
IPC_STRUCT_TRAITS_MEMBER(record_whole_document)
IPC_STRUCT_TRAITS_MEMBER(use_solid_color_scrollbars)
Expand Down
7 changes: 5 additions & 2 deletions content/public/common/content_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ const char kDisableDatabases[] = "disable-databases";
const char kDisableDomainBlockingFor3DAPIs[] =
"disable-domain-blocking-for-3d-apis";

// Disable experimental WebGL support.
const char kDisableExperimentalWebGL[] = "disable-webgl";
// Disable all versions of WebGL.
const char kDisableWebGL[] = "disable-webgl";

// Disable WebGL2.
const char kDisableWebGL2[] = "disable-webgl2";

// Comma-separated list of feature names to disable. See also kEnableFeatures.
const char kDisableFeatures[] = "disable-features";
Expand Down
3 changes: 2 additions & 1 deletion content/public/common/content_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ CONTENT_EXPORT extern const char kDisableDatabases[];
CONTENT_EXPORT extern const char kDisableDistanceFieldText[];
CONTENT_EXPORT extern const char kDisableDisplayList2dCanvas[];
extern const char kDisableDomainBlockingFor3DAPIs[];
CONTENT_EXPORT extern const char kDisableExperimentalWebGL[];
CONTENT_EXPORT extern const char kDisableWebGL[];
CONTENT_EXPORT extern const char kDisableWebGL2[];
CONTENT_EXPORT extern const char kDisableFeatures[];
CONTENT_EXPORT extern const char kDisableFileSystem[];
CONTENT_EXPORT extern const char kDisableFlash3d[];
Expand Down
3 changes: 2 additions & 1 deletion content/public/common/web_preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ WebPreferences::WebPreferences()
hyperlink_auditing_enabled(true),
allow_universal_access_from_file_urls(false),
allow_file_access_from_file_urls(false),
experimental_webgl_enabled(false),
webgl1_enabled(true),
webgl2_enabled(true),
pepper_3d_enabled(false),
flash_3d_enabled(true),
flash_stage3d_enabled(false),
Expand Down
3 changes: 2 additions & 1 deletion content/public/common/web_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ struct CONTENT_EXPORT WebPreferences {
bool hyperlink_auditing_enabled;
bool allow_universal_access_from_file_urls;
bool allow_file_access_from_file_urls;
bool experimental_webgl_enabled;
bool webgl1_enabled;
bool webgl2_enabled;
bool pepper_3d_enabled;
bool flash_3d_enabled;
bool flash_stage3d_enabled;
Expand Down
5 changes: 0 additions & 5 deletions content/renderer/pepper/pepper_plugin_instance_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,6 @@ bool PepperPluginInstanceImpl::Initialize(
UpdateTouchEventRequest();
UpdateWheelEventRequest();

SetGPUHistogram(ppapi::Preferences(PpapiPreferencesBuilder::Build(
render_frame_->render_view()->webkit_preferences())),
arg_names,
arg_values);

argn_ = arg_names;
argv_ = arg_values;
std::unique_ptr<const char* []> argn_array(StringVectorToArgArray(argn_));
Expand Down
26 changes: 0 additions & 26 deletions content/renderer/pepper/pepper_plugin_instance_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,4 @@ void RecordFlashClickSizeMetric(int width, int height) {
height);
}

void SetGPUHistogram(const ppapi::Preferences& prefs,
const std::vector<std::string>& arg_names,
const std::vector<std::string>& arg_values) {
// Calculate a histogram to let us determine how likely people are to try to
// run Stage3D content on machines that have it blacklisted.
#if defined(OS_WIN)
bool needs_gpu = false;

for (size_t i = 0; i < arg_names.size(); i++) {
if (arg_names[i] == "wmode") {
// In theory content other than Flash could have a "wmode" argument,
// but that's pretty unlikely.
if (arg_values[i] == "direct" || arg_values[i] == "gpu")
needs_gpu = true;
break;
}
}
// 0 : No 3D content and GPU is blacklisted
// 1 : No 3D content and GPU is not blacklisted
// 2 : 3D content but GPU is blacklisted
// 3 : 3D content and GPU is not blacklisted
UMA_HISTOGRAM_ENUMERATION("Flash.UsesGPU",
needs_gpu * 2 + prefs.is_webgl_supported, 8);
#endif
}

} // namespace content
11 changes: 0 additions & 11 deletions content/renderer/pepper/pepper_plugin_instance_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
#ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_METRICS_H_
#define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_METRICS_H_

#include <string>
#include <vector>

namespace ppapi {
struct Preferences;
}

namespace content {

// Record size metrics for all Flash instances.
Expand All @@ -20,10 +13,6 @@ void RecordFlashSizeMetric(int width, int height);
// Records size metrics for Flash instances that are clicked.
void RecordFlashClickSizeMetric(int width, int height);

void SetGPUHistogram(const ppapi::Preferences& prefs,
const std::vector<std::string>& arg_names,
const std::vector<std::string>& arg_values);

} // namespace content

#endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_METRICS_H_
1 change: 0 additions & 1 deletion content/renderer/pepper/ppapi_preferences_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ ppapi::Preferences PpapiPreferencesBuilder::Build(
ppapi_prefs.is_stage3d_supported = prefs.flash_stage3d_enabled;
ppapi_prefs.is_stage3d_baseline_supported =
prefs.flash_stage3d_baseline_enabled;
ppapi_prefs.is_webgl_supported = prefs.experimental_webgl_enabled;
ppapi_prefs.is_accelerated_video_decode_enabled =
prefs.pepper_accelerated_video_decode_enabled;
return ppapi_prefs;
Expand Down
7 changes: 2 additions & 5 deletions content/renderer/render_frame_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4741,15 +4741,12 @@ blink::WebString RenderFrameImpl::DoNotTrackValue() {
return WebString();
}

bool RenderFrameImpl::AllowWebGL(bool default_value) {
if (!default_value)
return false;

bool RenderFrameImpl::ShouldBlockWebGL() {
bool blocked = true;
Send(new FrameHostMsg_Are3DAPIsBlocked(
routing_id_, url::Origin(frame_->Top()->GetSecurityOrigin()).GetURL(),
THREE_D_API_TYPE_WEBGL, &blocked));
return !blocked;
return blocked;
}

bool RenderFrameImpl::AllowContentInitiatedDataUrlNavigations(
Expand Down
2 changes: 1 addition & 1 deletion content/renderer/render_frame_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class CONTENT_EXPORT RenderFrameImpl
blink::WebEncryptedMediaClient* EncryptedMediaClient() override;
blink::WebString UserAgentOverride() override;
blink::WebString DoNotTrackValue() override;
bool AllowWebGL(bool default_value) override;
bool ShouldBlockWebGL() override;
bool AllowContentInitiatedDataUrlNavigations(
const blink::WebURL& url) override;
blink::WebScreenOrientationClient* GetWebScreenOrientationClient() override;
Expand Down
5 changes: 2 additions & 3 deletions content/renderer/render_view_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->SetAllowFileAccessFromFileURLs(
prefs.allow_file_access_from_file_urls);

// Enable experimental WebGL support if requested on command line
// and support is compiled in.
settings->SetExperimentalWebGLEnabled(prefs.experimental_webgl_enabled);
settings->SetWebGL1Enabled(prefs.webgl1_enabled);
settings->SetWebGL2Enabled(prefs.webgl2_enabled);

// Enable WebGL errors to the JS console if requested.
settings->SetWebGLErrorsToConsoleEnabled(
Expand Down
1 change: 0 additions & 1 deletion content/shell/renderer/layout_test/blink_test_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ void ExportLayoutTestSpecificPreferences(
to->loads_images_automatically = from.loads_images_automatically;
to->plugins_enabled = from.plugins_enabled;
to->tabs_to_links = from.tabs_to_links;
to->experimental_webgl_enabled = from.experimental_webgl_enabled;
// experimentalCSSRegionsEnabled is deprecated and ignored.
to->hyperlink_auditing_enabled = from.hyperlink_auditing_enabled;
to->allow_running_insecure_content = from.allow_running_of_insecure_content;
Expand Down
1 change: 0 additions & 1 deletion content/shell/test_runner/test_preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ void TestPreferences::Reset() {
allow_file_access_from_file_urls = true;
allow_running_of_insecure_content = true;
default_text_encoding_name = WebString::FromUTF8("ISO-8859-1");
experimental_webgl_enabled = false;
experimental_css_grid_layout_enabled = true;
java_script_can_access_clipboard = true;
supports_multiple_windows = true;
Expand Down
1 change: 0 additions & 1 deletion content/shell/test_runner/test_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ struct TEST_RUNNER_EXPORT TestPreferences {
bool allow_file_access_from_file_urls;
bool allow_running_of_insecure_content;
blink::WebString default_text_encoding_name;
bool experimental_webgl_enabled;
bool experimental_css_grid_layout_enabled;
bool java_script_can_access_clipboard;
bool supports_multiple_windows;
Expand Down
2 changes: 0 additions & 2 deletions content/shell/test_runner/test_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2416,8 +2416,6 @@ void TestRunner::OverridePreference(const std::string& key,
prefs->plugins_enabled = value->BooleanValue();
} else if (key == "WebKitTabToLinksPreferenceKey") {
prefs->tabs_to_links = value->BooleanValue();
} else if (key == "WebKitWebGLEnabled") {
prefs->experimental_webgl_enabled = value->BooleanValue();
} else if (key == "WebKitCSSGridLayoutEnabled") {
prefs->experimental_css_grid_layout_enabled = value->BooleanValue();
} else if (key == "WebKitHyperlinkAuditingEnabled") {
Expand Down
28 changes: 21 additions & 7 deletions gpu/command_buffer/service/context_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,24 @@ ContextGroup::ContextGroup(
bool ContextGroup::Initialize(GLES2Decoder* decoder,
ContextType context_type,
const DisallowedFeatures& disallowed_features) {
bool enable_es3 = context_type == CONTEXT_TYPE_OPENGLES3 ||
context_type == CONTEXT_TYPE_WEBGL2;
if (!gpu_preferences_.enable_es3_apis && enable_es3) {
DLOG(ERROR) << "ContextGroup::Initialize failed because ES3 APIs are "
<< "not available.";
return false;
switch (context_type) {
case CONTEXT_TYPE_WEBGL1:
if (kGpuFeatureStatusBlacklisted ==
gpu_feature_info_.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL]) {
DLOG(ERROR) << "ContextGroup::Initialize failed: WebGL1 baclklisted";
return false;
}
break;
case CONTEXT_TYPE_WEBGL2:
if (kGpuFeatureStatusBlacklisted ==
gpu_feature_info_
.status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2]) {
DLOG(ERROR) << "ContextGroup::Initialize failed: WebGL2 blacklisted";
return false;
}
break;
default:
break;
}
if (HaveContexts()) {
if (context_type != feature_info_->context_type()) {
Expand Down Expand Up @@ -176,7 +188,9 @@ bool ContextGroup::Initialize(GLES2Decoder* decoder,
}
}

if (enable_es3 || feature_info_->feature_flags().ext_draw_buffers) {
if (context_type == CONTEXT_TYPE_OPENGLES3 ||
context_type == CONTEXT_TYPE_WEBGL2 ||
feature_info_->feature_flags().ext_draw_buffers) {
GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments_);
if (max_color_attachments_ < 1)
max_color_attachments_ = 1;
Expand Down
Loading

0 comments on commit a3fda99

Please sign in to comment.