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

Unified Diff: gpu/command_buffer/client/share_group.h

Issue 2826043002: Do not share FBOs/VAOs/Transform feedback objects across contexts (Closed)
Patch Set: added DeleteFramebuffers() expectation Created 3 years, 7 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
Index: gpu/command_buffer/client/share_group.h
diff --git a/gpu/command_buffer/client/share_group.h b/gpu/command_buffer/client/share_group.h
index 091b69f2385034d354e2f5946dcecabc67d4d2a2..08b40f05bc6f03490d8f7016cb2b2269be2aa1fc 100644
--- a/gpu/command_buffer/client/share_group.h
+++ b/gpu/command_buffer/client/share_group.h
@@ -32,6 +32,8 @@ typedef void (GLES2Implementation::*BindIndexedFn)( \
typedef void (GLES2Implementation::*BindIndexedRangeFn)( \
GLenum target, GLuint index, GLuint id, GLintptr offset, GLsizeiptr size);
+using SharedIdNamespaces = id_namespaces::SharedIdNamespaces;
+
class ShareGroupContextData {
public:
struct IdHandlerData {
@@ -47,7 +49,8 @@ class ShareGroupContextData {
}
private:
- IdHandlerData id_handler_data_[id_namespaces::kNumIdNamespaces];
+ IdHandlerData id_handler_data_[static_cast<int>(
+ SharedIdNamespaces::kNumSharedIdNamespaces)];
};
// Base class for IdHandlers
@@ -124,8 +127,8 @@ class GLES2_IMPL_EXPORT ShareGroup
return bind_generates_resource_;
}
- IdHandlerInterface* GetIdHandler(int namespace_id) const {
- return id_handlers_[namespace_id].get();
+ IdHandlerInterface* GetIdHandler(SharedIdNamespaces namespace_id) const {
+ return id_handlers_[static_cast<int>(namespace_id)].get();
}
RangeIdHandlerInterface* GetRangeIdHandler(int range_namespace_id) const {
@@ -137,7 +140,9 @@ class GLES2_IMPL_EXPORT ShareGroup
}
void FreeContext(GLES2Implementation* gl_impl) {
- for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) {
+ for (int i = 0;
+ i < static_cast<int>(SharedIdNamespaces::kNumSharedIdNamespaces);
+ ++i) {
id_handlers_[i]->FreeContext(gl_impl);
}
for (auto& range_id_handler : range_id_handlers_) {
@@ -162,8 +167,8 @@ class GLES2_IMPL_EXPORT ShareGroup
// Install a new program info manager. Used for testing only;
void SetProgramInfoManagerForTesting(ProgramInfoManager* manager);
- std::unique_ptr<IdHandlerInterface>
- id_handlers_[id_namespaces::kNumIdNamespaces];
+ std::unique_ptr<IdHandlerInterface> id_handlers_[static_cast<int>(
+ SharedIdNamespaces::kNumSharedIdNamespaces)];
std::unique_ptr<RangeIdHandlerInterface>
range_id_handlers_[id_namespaces::kNumRangeIdNamespaces];
std::unique_ptr<ProgramInfoManager> program_info_manager_;

Powered by Google App Engine
This is Rietveld 408576698