diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-29 04:16:17 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-29 04:16:17 +0000 |
commit | 41de2282baf73691595bb4e411603c9c08e0d055 (patch) | |
tree | 78fb84d6c79b941a34c7c9f9fd4dc31d5cc945d1 /webkit/common | |
parent | afcade6dd7ada5e53fa96e325268dc3986b29332 (diff) | |
download | chromium_src-41de2282baf73691595bb4e411603c9c08e0d055.zip chromium_src-41de2282baf73691595bb4e411603c9c08e0d055.tar.gz chromium_src-41de2282baf73691595bb4e411603c9c08e0d055.tar.bz2 |
Pass context capabilities via cc::ContextProvider instead of gl string
This migrates cc to checking for context capabilities through a struct
provided by the ContextProvider instead of parsing out the GL_EXTENSIONS
string manually. This is a very minor performance win, since we don't
parse the string multiple times. More importantly, this centralizes
capability testing into one place and breaks cc's dependency on
WebString.
The implementation of ContextCapabilities() in content still parses out
the extensions string from the context, but we can route this data in
more directly in a follow-up.
BUG=279518
Review URL: https://chromiumcodereview.appspot.com/23466003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/common')
-rw-r--r-- | webkit/common/gpu/context_provider_in_process.cc | 19 | ||||
-rw-r--r-- | webkit/common/gpu/context_provider_in_process.h | 4 |
2 files changed, 19 insertions, 4 deletions
diff --git a/webkit/common/gpu/context_provider_in_process.cc b/webkit/common/gpu/context_provider_in_process.cc index b7e3cc4..8ec17f4 100644 --- a/webkit/common/gpu/context_provider_in_process.cc +++ b/webkit/common/gpu/context_provider_in_process.cc @@ -133,8 +133,23 @@ bool ContextProviderInProcess::BindToCurrentThread() { return true; } -webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl* -ContextProviderInProcess::Context3d() { +cc::ContextProvider::Capabilities +ContextProviderInProcess::ContextCapabilities() { + // We always use a WebGraphicsContext3DInProcessCommandBufferImpl which + // provides the following capabilities: + Capabilities caps; + caps.bind_uniform_location = true; + caps.discard_backbuffer = true; + caps.map_image = true; + caps.map_sub = true; + caps.set_visibility = true; + caps.shallow_flush = true; + caps.texture_format_bgra8888 = true; + caps.texture_rectangle = true; + return caps; +} + +WebKit::WebGraphicsContext3D* ContextProviderInProcess::Context3d() { DCHECK(context3d_); DCHECK(lost_context_callback_proxy_); // Is bound to thread. DCHECK(context_thread_checker_.CalledOnValidThread()); diff --git a/webkit/common/gpu/context_provider_in_process.h b/webkit/common/gpu/context_provider_in_process.h index 2379dd2..5285f7b 100644 --- a/webkit/common/gpu/context_provider_in_process.h +++ b/webkit/common/gpu/context_provider_in_process.h @@ -33,8 +33,8 @@ class WEBKIT_GPU_EXPORT ContextProviderInProcess static scoped_refptr<ContextProviderInProcess> CreateOffscreen(); virtual bool BindToCurrentThread() OVERRIDE; - virtual webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl* - Context3d() OVERRIDE; + virtual Capabilities ContextCapabilities() OVERRIDE; + virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; virtual class GrContext* GrContext() OVERRIDE; virtual void VerifyContexts() OVERRIDE; virtual bool DestroyedOnMainThread() OVERRIDE; |