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

Side by Side Diff: chrome/browser/gpu_util.cc

Issue 10830011: Disable WebGL on Android by default (but allow it to be enabled) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/android/content_startup_flags.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gpu_util.h" 5 #include "chrome/browser/gpu_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 "css_animation", 325 "css_animation",
326 flags & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING, 326 flags & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING,
327 command_line.HasSwitch(switches::kDisableThreadedAnimation) || 327 command_line.HasSwitch(switches::kDisableThreadedAnimation) ||
328 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), 328 command_line.HasSwitch(switches::kDisableAcceleratedCompositing),
329 "Accelerated CSS animation has been disabled at the command line.", 329 "Accelerated CSS animation has been disabled at the command line.",
330 true 330 true
331 }, 331 },
332 { 332 {
333 "webgl", 333 "webgl",
334 flags & content::GPU_FEATURE_TYPE_WEBGL, 334 flags & content::GPU_FEATURE_TYPE_WEBGL,
335 #if defined(OS_ANDROID)
336 !command_line.HasSwitch(switches::kEnableExperimentalWebGL),
337 #else
335 command_line.HasSwitch(switches::kDisableExperimentalWebGL), 338 command_line.HasSwitch(switches::kDisableExperimentalWebGL),
339 #endif
336 "WebGL has been disabled, either via about:flags or command line.", 340 "WebGL has been disabled, either via about:flags or command line.",
337 false 341 false
338 }, 342 },
339 { 343 {
340 "multisampling", 344 "multisampling",
341 flags & content::GPU_FEATURE_TYPE_MULTISAMPLING, 345 flags & content::GPU_FEATURE_TYPE_MULTISAMPLING,
342 command_line.HasSwitch(switches::kDisableGLMultisampling), 346 command_line.HasSwitch(switches::kDisableGLMultisampling),
343 "Multisampling has been disabled, either via about:flags or command" 347 "Multisampling has been disabled, either via about:flags or command"
344 " line.", 348 " line.",
345 false 349 false
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 content::GPU_FEATURE_TYPE_WEBGL 574 content::GPU_FEATURE_TYPE_WEBGL
571 }; 575 };
572 const std::string kGpuBlacklistFeatureHistogramNames[] = { 576 const std::string kGpuBlacklistFeatureHistogramNames[] = {
573 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", 577 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas",
574 "GPU.BlacklistFeatureTestResults.AcceleratedCompositing", 578 "GPU.BlacklistFeatureTestResults.AcceleratedCompositing",
575 "GPU.BlacklistFeatureTestResults.Webgl" 579 "GPU.BlacklistFeatureTestResults.Webgl"
576 }; 580 };
577 const bool kGpuFeatureUserFlags[] = { 581 const bool kGpuFeatureUserFlags[] = {
578 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), 582 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas),
579 command_line.HasSwitch(switches::kDisableAcceleratedCompositing), 583 command_line.HasSwitch(switches::kDisableAcceleratedCompositing),
584 #if defined(OS_ANDROID)
585 !command_line.HasSwitch(switches::kEnableExperimentalWebGL)
586 #else
580 command_line.HasSwitch(switches::kDisableExperimentalWebGL) 587 command_line.HasSwitch(switches::kDisableExperimentalWebGL)
588 #endif
581 }; 589 };
582 #if defined(OS_WIN) 590 #if defined(OS_WIN)
583 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { 591 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = {
584 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", 592 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas",
585 "GPU.BlacklistFeatureTestResultsWindows.AcceleratedCompositing", 593 "GPU.BlacklistFeatureTestResultsWindows.AcceleratedCompositing",
586 "GPU.BlacklistFeatureTestResultsWindows.Webgl" 594 "GPU.BlacklistFeatureTestResultsWindows.Webgl"
587 }; 595 };
588 #endif 596 #endif
589 const size_t kNumFeatures = 597 const size_t kNumFeatures =
590 sizeof(kGpuFeatures) / sizeof(content::GpuFeatureType); 598 sizeof(kGpuFeatures) / sizeof(content::GpuFeatureType);
(...skipping 15 matching lines...) Expand all
606 kGpuBlacklistFeatureHistogramNamesWin[i], 614 kGpuBlacklistFeatureHistogramNamesWin[i],
607 1, kNumWinSubVersions * kGpuFeatureNumStatus, 615 1, kNumWinSubVersions * kGpuFeatureNumStatus,
608 kNumWinSubVersions * kGpuFeatureNumStatus + 1, 616 kNumWinSubVersions * kGpuFeatureNumStatus + 1,
609 base::Histogram::kUmaTargetedHistogramFlag); 617 base::Histogram::kUmaTargetedHistogramFlag);
610 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); 618 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value));
611 #endif 619 #endif
612 } 620 }
613 } 621 }
614 622
615 } // namespace gpu_util; 623 } // namespace gpu_util;
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/content_startup_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698