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

Side by Side Diff: gpu/command_buffer/client/share_group.h

Issue 455783002: GPU context creation code duplication cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_
7 7
8 #include <GLES2/gl2.h> 8 #include <GLES2/gl2.h>
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "gles2_impl_export.h" 10 #include "gles2_impl_export.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // ShareGroup manages shared resources for contexts that are sharing resources. 64 // ShareGroup manages shared resources for contexts that are sharing resources.
65 class GLES2_IMPL_EXPORT ShareGroup 65 class GLES2_IMPL_EXPORT ShareGroup
66 : public gpu::RefCountedThreadSafe<ShareGroup> { 66 : public gpu::RefCountedThreadSafe<ShareGroup> {
67 public: 67 public:
68 ShareGroup(bool bind_generates_resource); 68 ShareGroup(bool bind_generates_resource);
69 69
70 bool bind_generates_resource() const { 70 bool bind_generates_resource() const {
71 return bind_generates_resource_; 71 return bind_generates_resource_;
72 } 72 }
73 73
74 bool Initialize();
75
76 IdHandlerInterface* GetIdHandler(int namespace_id) const { 74 IdHandlerInterface* GetIdHandler(int namespace_id) const {
77 return id_handlers_[namespace_id].get(); 75 return id_handlers_[namespace_id].get();
78 } 76 }
79 77
80 ProgramInfoManager* program_info_manager() { 78 ProgramInfoManager* program_info_manager() {
81 return program_info_manager_.get(); 79 return program_info_manager_.get();
82 } 80 }
83 81
84 void FreeContext(GLES2Implementation* gl_impl) { 82 void FreeContext(GLES2Implementation* gl_impl) {
85 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { 83 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) {
(...skipping 14 matching lines...) Expand all
100 98
101 bool bind_generates_resource_; 99 bool bind_generates_resource_;
102 100
103 DISALLOW_COPY_AND_ASSIGN(ShareGroup); 101 DISALLOW_COPY_AND_ASSIGN(ShareGroup);
104 }; 102 };
105 103
106 } // namespace gles2 104 } // namespace gles2
107 } // namespace gpu 105 } // namespace gpu
108 106
109 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ 107 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698