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

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

Issue 1278333003: Fix crash caused by concurrent access to framebuffer_combo_complete_map_. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments; return unittesting of cache behaviour. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/framebuffer_manager.h
diff --git a/gpu/command_buffer/service/framebuffer_manager.h b/gpu/command_buffer/service/framebuffer_manager.h
index 9bf440a17d03b18bd3491e859bd90c93f7108c0f..1cff44e4040fd34a8269fecddb991cb1be8573f3 100644
--- a/gpu/command_buffer/service/framebuffer_manager.h
+++ b/gpu/command_buffer/service/framebuffer_manager.h
@@ -18,6 +18,7 @@
namespace gpu {
namespace gles2 {
+class FramebufferCompletenessCache;
class FramebufferManager;
class Renderbuffer;
class RenderbufferManager;
@@ -156,12 +157,6 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
// formats.
bool HasSameInternalFormatsMRT() const;
- static void ClearFramebufferCompleteComboMap();
-
- static bool AllowFramebufferComboCompleteMapForTesting() {
- return allow_framebuffer_combo_complete_map_;
- }
-
void OnTextureRefDetached(TextureRef* texture);
void OnWillRenderTo() const;
void OnDidRenderTo() const;
@@ -217,12 +212,6 @@ class GPU_EXPORT Framebuffer : public base::RefCounted<Framebuffer> {
typedef base::hash_map<GLenum, scoped_refptr<Attachment> > AttachmentMap;
AttachmentMap attachments_;
- // A map of successful frame buffer combos. If it's in the map
- // it should be FRAMEBUFFER_COMPLETE.
- typedef base::hash_map<std::string, bool> FramebufferComboCompleteMap;
- static FramebufferComboCompleteMap* framebuffer_combo_complete_map_;
- static bool allow_framebuffer_combo_complete_map_;
-
scoped_ptr<GLenum[]> draw_buffers_;
GLenum read_buffer_;
@@ -258,8 +247,11 @@ class GPU_EXPORT FramebufferManager {
DISALLOW_COPY_AND_ASSIGN(TextureDetachObserver);
};
- FramebufferManager(uint32 max_draw_buffers, uint32 max_color_attachments,
- ContextGroup::ContextType context_type);
+ FramebufferManager(uint32 max_draw_buffers,
+ uint32 max_color_attachments,
+ ContextGroup::ContextType context_type,
+ const scoped_refptr<FramebufferCompletenessCache>&
+ framebuffer_combo_complete_cache);
~FramebufferManager();
// Must call before destruction.
@@ -308,6 +300,12 @@ class GPU_EXPORT FramebufferManager {
return context_type_;
}
+ void SetFramebufferComboCompleteCacheForTesting(
+ const scoped_refptr<FramebufferCompletenessCache>&
+ framebuffer_combo_complete_cache) {
+ framebuffer_combo_complete_cache_ = framebuffer_combo_complete_cache;
+ }
+
private:
friend class Framebuffer;
@@ -316,6 +314,10 @@ class GPU_EXPORT FramebufferManager {
void OnTextureRefDetached(TextureRef* texture);
+ FramebufferCompletenessCache* GetFramebufferComboCompleteCache() {
+ return framebuffer_combo_complete_cache_.get();
+ }
+
// Info for each framebuffer in the system.
typedef base::hash_map<GLuint, scoped_refptr<Framebuffer> >
FramebufferMap;
@@ -339,6 +341,8 @@ class GPU_EXPORT FramebufferManager {
typedef std::vector<TextureDetachObserver*> TextureDetachObserverVector;
TextureDetachObserverVector texture_detach_observers_;
+ scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_;
+
DISALLOW_COPY_AND_ASSIGN(FramebufferManager);
};

Powered by Google App Engine
This is Rietveld 408576698