diff options
author | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-26 16:28:52 +0000 |
---|---|---|
committer | zmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-26 16:28:52 +0000 |
commit | c35ef3844edab1e5f6f74a9b1c8ed797b974777f (patch) | |
tree | aa421c6d9e60d73dcfc48dcc4a1b87f5503b360f /content/browser | |
parent | 1d380bc0dd9339dbb0f1f56545aa14736a59dc59 (diff) | |
download | chromium_src-c35ef3844edab1e5f6f74a9b1c8ed797b974777f.zip chromium_src-c35ef3844edab1e5f6f74a9b1c8ed797b974777f.tar.gz chromium_src-c35ef3844edab1e5f6f74a9b1c8ed797b974777f.tar.bz2 |
Fix about:gpu's wrong status of accelerated-canvas-2d.
The decision whether to support accelerated-canvas-2d is made on the renderer side. This CL duplicates the same logic on the browser side, so about:gpu reports the correct feature status.
An alternative is to add an IPC messege to query renderer side about the feature status, which isn't very appealing.
BUG=100722
TEST=about:gpu
Review URL: http://codereview.chromium.org/8341036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/gpu/gpu_data_manager.cc | 17 | ||||
-rw-r--r-- | content/browser/gpu/gpu_data_manager.h | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/content/browser/gpu/gpu_data_manager.cc b/content/browser/gpu/gpu_data_manager.cc index 8bd3bbd..991daac 100644 --- a/content/browser/gpu/gpu_data_manager.cc +++ b/content/browser/gpu/gpu_data_manager.cc @@ -264,8 +264,10 @@ Value* GpuDataManager::GetFeatureStatus() { { "2d_canvas", flags & GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas, - user_flags_.disable_accelerated_2d_canvas(), - "Accelerated 2D canvas has been disabled at the command line.", + user_flags_.disable_accelerated_2d_canvas() || + !supportsAccelerated2dCanvas(), + "Accelerated 2D canvas is unavailable: either disabled at the command" + " line or not supported by the current system.", true }, { @@ -762,3 +764,14 @@ bool GpuDataManager::Merge(content::GPUInfo* object, } return changed; } + +bool GpuDataManager::supportsAccelerated2dCanvas() const { + if (gpu_info_.can_lose_context) + return false; +#if defined(USE_SKIA) + return true; +#else + return false; +#endif +} + diff --git a/content/browser/gpu/gpu_data_manager.h b/content/browser/gpu/gpu_data_manager.h index e92f716..b91e10c 100644 --- a/content/browser/gpu/gpu_data_manager.h +++ b/content/browser/gpu/gpu_data_manager.h @@ -187,6 +187,10 @@ class CONTENT_EXPORT GpuDataManager { // and gl_renderer. static bool Merge(content::GPUInfo* object, const content::GPUInfo& other); + // Determin if accelerated-2d-canvas is supported, which depends on whether + // lose_context could happen and whether skia is the backend. + bool supportsAccelerated2dCanvas() const; + bool complete_gpu_info_already_requested_; GpuFeatureFlags gpu_feature_flags_; |