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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

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/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 3651a90c5494e794652439e1b2b18b4e8a79b058..ee7582839011c5b5797487c6075baf3e63d18f71 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -569,6 +569,9 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
void RestoreAllAttributes() const override;
QueryManager* GetQueryManager() override { return query_manager_.get(); }
+ FramebufferManager* GetFramebufferManager() override {
+ return framebuffer_manager_.get();
+ }
TransformFeedbackManager* GetTransformFeedbackManager() override {
return transform_feedback_manager_.get();
}
@@ -723,7 +726,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
}
FramebufferManager* framebuffer_manager() {
- return group_->framebuffer_manager();
+ return framebuffer_manager_.get();
}
ProgramManager* program_manager() {
@@ -2322,6 +2325,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
// Whether the client requested an offscreen buffer with an alpha channel.
bool offscreen_buffer_should_have_alpha_;
+ std::unique_ptr<FramebufferManager> framebuffer_manager_;
+
std::unique_ptr<QueryManager> query_manager_;
std::unique_ptr<VertexArrayManager> vertex_array_manager_;
@@ -3250,6 +3255,11 @@ bool GLES2DecoderImpl::Initialize(
// vertex_attrib_manager is set to default_vertex_attrib_manager by this call
DoBindVertexArrayOES(0);
+ framebuffer_manager_.reset(new FramebufferManager(
+ group_->max_draw_buffers(), group_->max_color_attachments(),
+ group_->framebuffer_completeness_cache()));
+ group_->texture_manager()->AddFramebufferManager(framebuffer_manager_.get());
+
query_manager_.reset(new QueryManager(this, feature_info_.get()));
image_manager_.reset(new ImageManager);
@@ -4856,6 +4866,14 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
srgb_converter_.reset();
clear_framebuffer_blit_.reset();
+ if (framebuffer_manager_.get()) {
+ framebuffer_manager_->Destroy(have_context);
+ if (group_->texture_manager())
+ group_->texture_manager()->RemoveFramebufferManager(
+ framebuffer_manager_.get());
+ framebuffer_manager_.reset();
+ }
+
if (query_manager_.get()) {
query_manager_->Destroy(have_context);
query_manager_.reset();

Powered by Google App Engine
This is Rietveld 408576698