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); |
}; |