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

Unified Diff: gpu/command_buffer/service/texture_manager.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/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 8ae7adec45bc9423bf290664406cb384a941efb8..3aea567df12e77edfe4d0106935a071ecc322ef3 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1893,7 +1893,6 @@ TextureManager::TextureManager(MemoryTracker* memory_tracker,
: memory_type_tracker_(new MemoryTypeTracker(memory_tracker)),
memory_tracker_(memory_tracker),
feature_info_(feature_info),
- framebuffer_manager_(NULL),
max_texture_size_(max_texture_size),
max_cube_map_texture_size_(max_cube_map_texture_size),
max_rectangle_texture_size_(max_rectangle_texture_size),
@@ -1924,6 +1923,23 @@ TextureManager::TextureManager(MemoryTracker* memory_tracker,
}
}
+void TextureManager::AddFramebufferManager(
+ FramebufferManager* framebuffer_manager) {
+ framebuffer_managers_.push_back(framebuffer_manager);
+}
+
+void TextureManager::RemoveFramebufferManager(
+ FramebufferManager* framebuffer_manager) {
+ for (unsigned int i = 0; i < framebuffer_managers_.size(); ++i) {
+ if (framebuffer_managers_[i] == framebuffer_manager) {
+ std::swap(framebuffer_managers_[i], framebuffer_managers_.back());
+ framebuffer_managers_.pop_back();
+ return;
+ }
+ }
+ NOTREACHED();
+}
+
bool TextureManager::Initialize() {
// Reset PIXEL_UNPACK_BUFFER to avoid unrelated GL error on some GL drivers.
if (feature_info_->gl_version_info().is_es3_capable) {
@@ -2332,8 +2348,9 @@ void TextureManager::UpdateNumImages(int delta) {
}
void TextureManager::IncFramebufferStateChangeCount() {
- if (framebuffer_manager_)
- framebuffer_manager_->IncFramebufferStateChangeCount();
+ for (unsigned int i = 0; i < framebuffer_managers_.size(); ++i) {
+ framebuffer_managers_[i]->IncFramebufferStateChangeCount();
+ }
}
bool TextureManager::ValidateTextureParameters(

Powered by Google App Engine
This is Rietveld 408576698