summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 20:59:10 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 20:59:10 +0000
commit4ddb900984e74201a1923927f6a5bd4cbda3524e (patch)
treef9ec0a1fb36ec5bc5f30d712a6483ee9ac430e88
parented77c9a68c6b4f897c30163b778f1df46f8caa10 (diff)
downloadchromium_src-4ddb900984e74201a1923927f6a5bd4cbda3524e.zip
chromium_src-4ddb900984e74201a1923927f6a5bd4cbda3524e.tar.gz
chromium_src-4ddb900984e74201a1923927f6a5bd4cbda3524e.tar.bz2
Allow blacklisting just sharing textures between processes.
This will allow us to move some of the hardcoded blacklisting logic into the blacklist. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10698172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147527 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gpu_blacklist.cc1
-rw-r--r--chrome/browser/gpu_util.cc13
-rw-r--r--chrome/browser/gpu_util.h3
-rw-r--r--chrome/browser/resources/gpu_internals/info_view.js3
-rw-r--r--chrome/browser/resources/software_rendering_list.json3
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc2
-rw-r--r--content/common/sandbox_policy.cc3
-rw-r--r--content/public/common/gpu_feature_type.h4
8 files changed, 27 insertions, 5 deletions
diff --git a/chrome/browser/gpu_blacklist.cc b/chrome/browser/gpu_blacklist.cc
index bddb3c7..685227c 100644
--- a/chrome/browser/gpu_blacklist.cc
+++ b/chrome/browser/gpu_blacklist.cc
@@ -729,6 +729,7 @@ bool GpuBlacklist::GpuBlacklistEntry::SetBlacklistedFeatures(
case content::GPU_FEATURE_TYPE_MULTISAMPLING:
case content::GPU_FEATURE_TYPE_FLASH3D:
case content::GPU_FEATURE_TYPE_FLASH_STAGE3D:
+ case content::GPU_FEATURE_TYPE_TEXTURE_SHARING:
case content::GPU_FEATURE_TYPE_ALL:
feature_type |= type;
break;
diff --git a/chrome/browser/gpu_util.cc b/chrome/browser/gpu_util.cc
index 10293ad..ac98796 100644
--- a/chrome/browser/gpu_util.cc
+++ b/chrome/browser/gpu_util.cc
@@ -38,6 +38,7 @@ const char kGpuFeatureNameWebgl[] = "webgl";
const char kGpuFeatureNameMultisampling[] = "multisampling";
const char kGpuFeatureNameFlash3d[] = "flash_3d";
const char kGpuFeatureNameFlashStage3d[] = "flash_stage3d";
+const char kGpuFeatureNameTextureSharing[] = "texture_sharing";
const char kGpuFeatureNameAll[] = "all";
const char kGpuFeatureNameUnknown[] = "unknown";
@@ -237,6 +238,8 @@ GpuFeatureType StringToGpuFeatureType(const std::string& feature_string) {
return content::GPU_FEATURE_TYPE_FLASH3D;
else if (feature_string == kGpuFeatureNameFlashStage3d)
return content::GPU_FEATURE_TYPE_FLASH_STAGE3D;
+ else if (feature_string == kGpuFeatureNameTextureSharing)
+ return content::GPU_FEATURE_TYPE_TEXTURE_SHARING;
else if (feature_string == kGpuFeatureNameAll)
return content::GPU_FEATURE_TYPE_ALL;
return content::GPU_FEATURE_TYPE_UNKNOWN;
@@ -259,6 +262,8 @@ std::string GpuFeatureTypeToString(GpuFeatureType type) {
matches.push_back(kGpuFeatureNameFlash3d);
if (type & content::GPU_FEATURE_TYPE_FLASH_STAGE3D)
matches.push_back(kGpuFeatureNameFlashStage3d);
+ if (type & content::GPU_FEATURE_TYPE_TEXTURE_SHARING)
+ matches.push_back(kGpuFeatureNameTextureSharing);
if (!matches.size())
matches.push_back(kGpuFeatureNameUnknown);
}
@@ -336,6 +341,14 @@ Value* GetFeatureStatus() {
"Using Stage3d in Flash has been disabled, either via about:flags or"
" command line.",
false
+ },
+ {
+ "texture_sharing",
+ flags & content::GPU_FEATURE_TYPE_TEXTURE_SHARING,
+ command_line.HasSwitch(switches::kDisableImageTransportSurface),
+ "Sharing textures between processes has been disabled, either via"
+ " about:flags or command line.",
+ false
}
};
const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo);
diff --git a/chrome/browser/gpu_util.h b/chrome/browser/gpu_util.h
index 42e6696..e3aacad 100644
--- a/chrome/browser/gpu_util.h
+++ b/chrome/browser/gpu_util.h
@@ -50,7 +50,8 @@ std::string GpuFeatureTypeToString(content::GpuFeatureType feature);
// 'webgl',
// 'multisampling',
// 'flash_3d',
-// 'flash_stage3d'
+// 'flash_stage3d',
+// 'texture_sharing'
//
// Each problems has:
// {
diff --git a/chrome/browser/resources/gpu_internals/info_view.js b/chrome/browser/resources/gpu_internals/info_view.js
index 8ada14e..ed9a017 100644
--- a/chrome/browser/resources/gpu_internals/info_view.js
+++ b/chrome/browser/resources/gpu_internals/info_view.js
@@ -81,7 +81,8 @@ cr.define('gpu', function() {
'webgl': 'WebGL',
'multisampling': 'WebGL multisampling',
'flash_3d': 'Flash 3D',
- 'flash_stage3d': 'Flash Stage3D'
+ 'flash_stage3d': 'Flash Stage3D',
+ 'texture_sharing': 'Texture Sharing'
};
var statusLabelMap = {
'disabled_software': 'Software only. Hardware acceleration disabled.',
diff --git a/chrome/browser/resources/software_rendering_list.json b/chrome/browser/resources/software_rendering_list.json
index 460c00d..3218681 100644
--- a/chrome/browser/resources/software_rendering_list.json
+++ b/chrome/browser/resources/software_rendering_list.json
@@ -34,7 +34,8 @@
// 14. "exceptions" is a list of entries.
// 15. "blacklist" is a list of gpu feature strings, valid values include
// "accelerated_2d_canvas", "accelerated_compositing", "webgl",
-// "multisampling", "flash_3d", "flash_stage3d", and "all".
+// "multisampling", "flash_3d", "flash_stage3d", "texture_sharing",
+// and "all".
// This field is mandatory.
// 16. "description" has the description of the entry.
// 17. "webkit_bugs" is an array of associated webkit bug numbers.
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index 1eb1522..86f64cf 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -194,6 +194,8 @@ void GpuDataManagerImpl::AppendGpuCommandLine(
if ((flags & content::GPU_FEATURE_TYPE_MULTISAMPLING) &&
!command_line->HasSwitch(switches::kDisableGLMultisampling))
command_line->AppendSwitch(switches::kDisableGLMultisampling);
+ if (flags & content::GPU_FEATURE_TYPE_TEXTURE_SHARING)
+ command_line->AppendSwitch(switches::kDisableImageTransportSurface);
if (software_rendering_) {
command_line->AppendSwitchASCII(switches::kUseGL, "swiftshader");
diff --git a/content/common/sandbox_policy.cc b/content/common/sandbox_policy.cc
index 2878f2c..fb38648 100644
--- a/content/common/sandbox_policy.cc
+++ b/content/common/sandbox_policy.cc
@@ -343,7 +343,8 @@ bool AddPolicyForGPU(CommandLine* cmd_line, sandbox::TargetPolicy* policy) {
} else {
if (cmd_line->GetSwitchValueASCII(switches::kUseGL) ==
gfx::kGLImplementationSwiftShaderName ||
- cmd_line->HasSwitch(switches::kReduceGpuSandbox)) {
+ cmd_line->HasSwitch(switches::kReduceGpuSandbox) ||
+ cmd_line->HasSwitch(switches::kDisableImageTransportSurface)) {
// Swiftshader path.
policy->SetTokenLevel(sandbox::USER_RESTRICTED_SAME_ACCESS,
sandbox::USER_LIMITED);
diff --git a/content/public/common/gpu_feature_type.h b/content/public/common/gpu_feature_type.h
index 114babc..662fc7c 100644
--- a/content/public/common/gpu_feature_type.h
+++ b/content/public/common/gpu_feature_type.h
@@ -17,12 +17,14 @@ enum GpuFeatureType {
GPU_FEATURE_TYPE_MULTISAMPLING = 1 << 3,
GPU_FEATURE_TYPE_FLASH3D = 1 << 4,
GPU_FEATURE_TYPE_FLASH_STAGE3D = 1 << 5,
+ GPU_FEATURE_TYPE_TEXTURE_SHARING = 1 << 6,
GPU_FEATURE_TYPE_ALL = GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS |
GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING |
GPU_FEATURE_TYPE_WEBGL |
GPU_FEATURE_TYPE_MULTISAMPLING |
GPU_FEATURE_TYPE_FLASH3D |
- GPU_FEATURE_TYPE_FLASH_STAGE3D,
+ GPU_FEATURE_TYPE_FLASH_STAGE3D |
+ GPU_FEATURE_TYPE_TEXTURE_SHARING,
// All flags initialized to false, i.e., no feature is blacklisted.
GPU_FEATURE_TYPE_UNKNOWN = 0
};