diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-14 04:15:58 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-14 04:15:58 +0000 |
commit | e4f8181d78bcc220e28a36c626fbbd364d455fd6 (patch) | |
tree | 5d3c42778bf3e7f490e0d9ac4cf8195c880404dd /content/gpu | |
parent | b5828c7bcdb69c690c7158bc4e5b6de2bc212462 (diff) | |
download | chromium_src-e4f8181d78bcc220e28a36c626fbbd364d455fd6.zip chromium_src-e4f8181d78bcc220e28a36c626fbbd364d455fd6.tar.gz chromium_src-e4f8181d78bcc220e28a36c626fbbd364d455fd6.tar.bz2 |
Implement WebKitPlatformSupport::canAccelerate2dCanvas
We do not want to use the accelerated 2d canvas path if we can lose a context
"too easily" - for example due to the screensaver turning on - or if we're using
a software rendering backend for GL contexts (swiftshader). The way these conditions
are currently checked for are awkard and racy. This adds an explicit check that
WebKit calls prior to instantiating an accelerated context for canvas. This
does two things:
1.) Attempt to spin up the GpuChannelHost. If we can't do this, then we definitely
don't need to bother. Note that if the GPU process crashes this will establish a
connection to the new GPU process.
2.) Query the can_lose_context and software_rendering bits from the new channel.
These are both properties of the GPU process, not of individual contexts, so we
don't need to have a particular context ready in order to do this.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/9655017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r-- | content/gpu/gpu_info_collector_win.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc index c2e85b4..2f7cc83 100644 --- a/content/gpu/gpu_info_collector_win.cc +++ b/content/gpu/gpu_info_collector_win.cc @@ -106,8 +106,10 @@ bool CollectGraphicsInfo(content::GPUInfo* gpu_info) { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { std::string requested_implementation_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); - if (requested_implementation_name == "swiftshader") + if (requested_implementation_name == "swiftshader") { + gpu_info->software_rendering = true; return false; + } } if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |