Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: gpu/command_buffer/service/context_group.h

Issue 1143393007: Teach GPU command buffer whether a context is webgl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_group.h
diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h
index 95cd4be2a92b9bc20c29d0fc0246c1a8ef97f8c6..5226aa10d6979643a41d48c5c737b263b52f5f96 100644
--- a/gpu/command_buffer/service/context_group.h
+++ b/gpu/command_buffer/service/context_group.h
@@ -44,6 +44,15 @@ struct DisallowedFeatures;
// resources.
class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
public:
+ enum ContextType {
+ kContextTypeWebGL1,
piman 2015/06/09 02:19:37 nit: CONTEXT_TYPE_WEBGL1 etc. per style guide.
Zhenyao Mo 2015/06/09 03:50:23 Actually the new style guide prefers the constant
+ kContextTypeWebGL2,
+ kContextTypeOther,
+ kContextTypeUndefined
+ };
+
+ static ContextType GetContextType(unsigned webgl_version);
+
ContextGroup(
const scoped_refptr<MailboxManager>& mailbox_manager,
const scoped_refptr<MemoryTracker>& memory_tracker,
@@ -57,6 +66,7 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
// call to destroy if it succeeds.
bool Initialize(
GLES2Decoder* decoder,
+ ContextType context_type,
const DisallowedFeatures& disallowed_features);
// Destroys all the resources when called for the last context in the group.
@@ -249,6 +259,8 @@ class GPU_EXPORT ContextGroup : public base::RefCounted<ContextGroup> {
bool QueryGLFeatureU(GLenum pname, GLint min_required, uint32* v);
bool HaveContexts();
+ ContextType context_type_;
+
scoped_refptr<MailboxManager> mailbox_manager_;
scoped_refptr<MemoryTracker> memory_tracker_;
scoped_refptr<ShaderTranslatorCache> shader_translator_cache_;
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | gpu/command_buffer/service/context_group.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698