summaryrefslogtreecommitdiffstats
path: root/cc/output/context_provider.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-29 04:16:17 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-29 04:16:17 +0000
commit41de2282baf73691595bb4e411603c9c08e0d055 (patch)
tree78fb84d6c79b941a34c7c9f9fd4dc31d5cc945d1 /cc/output/context_provider.h
parentafcade6dd7ada5e53fa96e325268dc3986b29332 (diff)
downloadchromium_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 'cc/output/context_provider.h')
-rw-r--r--cc/output/context_provider.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h
index 7d61763..3aae7eb 100644
--- a/cc/output/context_provider.h
+++ b/cc/output/context_provider.h
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "cc/base/cc_export.h"
class GrContext;
namespace WebKit { class WebGraphicsContext3D; }
@@ -25,6 +26,28 @@ class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> {
virtual WebKit::WebGraphicsContext3D* Context3d() = 0;
virtual class GrContext* GrContext() = 0;
+ struct Capabilities {
+ bool bind_uniform_location;
+ bool discard_backbuffer;
+ bool egl_image_external;
+ bool fast_npot_mo8_textures;
+ bool iosurface;
+ bool map_image;
+ bool map_sub;
+ bool post_sub_buffer;
+ bool set_visibility;
+ bool shallow_flush;
+ bool swapbuffers_complete_callback;
+ bool texture_format_bgra8888;
+ bool texture_rectangle;
+ bool texture_storage;
+ bool texture_usage;
+
+ CC_EXPORT Capabilities();
+ };
+ // Returns the capabilities of the currently bound 3d context.
+ virtual Capabilities ContextCapabilities() = 0;
+
// Ask the provider to check if the contexts are valid or lost. If they are,
// this should invalidate the provider so that it can be replaced with a new
// one.